Extreme Pressure Zones Indicator (EPZ) [BullByte]Extreme Pressure Zones Indicator(EPZ)
The Extreme Pressure Zones (EPZ) Indicator is a proprietary market analysis tool designed to highlight potential overbought and oversold "pressure zones" in any financial chart. It does this by combining several unique measurements of price action and volume into a single, bounded oscillator (0โ100). Unlike simple momentum or volatility indicators, EPZ captures multiple facets of market pressure: price rejection, trend momentum, supply/demand imbalance, and institutional (smart money) flow. This is not a random mashup of generic indicators; each component was chosen and weighted to reveal extreme market conditions that often precede reversals or strong continuations.
What it is?
EPZ estimates buying/selling pressure and highlights potential extreme zones with a single, bounded 0โ100 oscillator built from four normalized components. Context-aware weighting adapts to volatility, trendiness, and relative volume. Visual tools include adaptive thresholds, confirmed-on-close extremes, divergence, an MTF dashboard, and optional gradient candles.
Purpose and originality (not a mashup)
Purpose: Identify when pressure is building or reaching potential extremes while filtering noise across regimes and symbols.
Originality: EPZ integrates price rejection, momentum cascade, pressure distribution, and smart money flow into one bounded scale with context-aware weighting. It is not a cosmetic mashup of public indicators.
Why a trader might use EPZ
EPZ provides a multi-dimensional gauge of market extremes that standalone indicators may miss. Traders might use it to:
Spot Reversals: When EPZ enters an "Extreme High" zone (high red), it implies selling pressure might soon dominate. This can hint at a topside reversal or at least a pause in rallies. Conversely, "Extreme Low" (green) can highlight bottom-fish opportunities. The indicator's divergence module (optional) also finds hidden bullish/bearish divergences between price and EPZ, a clue that price momentum is weakening.
Measure Momentum Shifts: Because EPZ blends momentum and volume, it reacts faster than many single metrics. A rising MPO indicates building bullish pressure, while a falling MPO shows increasing bearish pressure. Traders can use this like a refined RSI: above 50 means bullish bias, below 50 means bearish bias, but with context provided by the thresholds.
Filter Trades: In trend-following systems, one could require EPZ to be in the bullish (green) zone before taking longs, or avoid new trades when EPZ is extreme. In mean-reversion systems, one might specifically look to fade extremes flagged by EPZ.
Multi-Timeframe Confirmation: The dashboard can fetch a higher timeframe EPZ value. For example, you might trade a 15-minute chart only when the 60-minute EPZ agrees on pressure direction.
Components and how they're combined
Rejection (PRV) โ Captures price rejection based on candle wicks and volume (see Price Rejection Volume).
Momentum Cascade (MCD) โ Blends multiple momentum periods (3,5,8,13) into a normalized momentum score.
Pressure Distribution (PDI) โ Measures net buy/sell pressure by comparing volume on up vs down candles.
Smart Money Flow (SMF) โ An adaptation of money flow index that emphasizes unusual volume spikes.
Each of these components produces a 0โ100 value (higher means more bullish pressure). They are then weighted and averaged into the final Market Pressure Oscillator (MPO), which is smoothed and scaled. By combining these four views, EPZ stands out as a comprehensive pressure gauge โ the whole is greater than the sum of parts
Context-aware weighting:
Higher volatility โ more PRV weight
Trendiness up (RSI of ATR > 25) โ more MCD weight
Relative volume > 1.2x โ more PDI weight
SMF holds a stable weight
The weighted average is smoothed and scaled into MPO โ with 50 as the neutral midline.
What makes EPZ stand out
Four orthogonal inputs (price action, momentum, pressure, flow) unified in a single bounded oscillator with consistent thresholds.
Adaptive thresholds (optional) plus robust extreme detection that also triggers on crossovers, so static thresholds work reliably too.
Confirm Extremes on Bar Close (default ON): dots/arrows/labels/alerts print on closed bars to avoid repaint confusion.
Clean dashboard, divergence tools, pre-alerts, and optional on-price gradients. Visual 3D layering uses offsets for depth only,no lookahead.
Recommended markets and timeframes
Best: liquid symbols (index futures, large-cap equities, major FX, BTC/ETH).
Timeframes: 5โ15m (more signals; consider higher thresholds), 1Hโ4H (balanced), 1D (clear regimes).
Use caution on illiquid or very low TFs where wick/volume geometry is erratic.
Logic and thresholds
MPO โ ; 50 = neutral. Above 50 = bullish pressure; below 50 = bearish.
Static thresholds (defaults): thrHigh = 70, thrLow = 30; warning bands 5 pts inside extremes (65/35).
Adaptive thresholds (optional):
thrHigh = min(BaseHigh + 5, mean(MPO,100) + stdev(MPO,100) ร ExtremeSensitivity)
thrLow = max(BaseLow โ 5, mean(MPO,100) โ stdev(MPO,100) ร ExtremeSensitivity)
Extreme detection
High: MPO โฅ thrHigh with peak/slope or crossover filter.
Low: MPO โค thrLow with trough/slope or crossover filter.
Cooldown: 5 bars (default). A new extreme will not print until the cooldown elapses, even if MPO re-enters the zone.
Confirmation
"Confirm Extremes on Bar Close" (default ON) gates extreme markers, pre-alerts, and alerts to closed bars (non-repainting).
Divergences
Pivot-based bullish/bearish divergence; tags appear only after left/right bars elapse (lookbackPivot).
MTF
HTF MPO retrieved with lookahead_off; values can update intrabar and finalize at HTF close. This is disclosed and expected.
Inputs and defaults (key ones)
Core: Sensitivity=1.0; Analysis Period=14; Smoothing=3; Adaptive Thresholds=OFF.
Extremes: Base High=70, Base Low=30; Extreme Sensitivity=1.5; Confirm Extremes on Bar Close=ON; Cooldown=5; Dot size Small/Tiny.
Visuals: Heatmap ON; 3D depth optional; Strength bars ON; Pre-alerts OFF; Divergences ON with tags ON; Gradient candles OFF; Glow ON.
Dashboard: ON; Position=Top Right; Size=Normal; MTF ON; HTF=60m; compact overlay table on price chart.
Advanced caps: Max Oscillator Labels=80; Max Extreme Guide Lines=80; Divergence objects=60.
Dashboard: what each element means
Header: EPZ ANALYSIS.
Large readout: Current MPO; color reflects state (extreme, approaching, or neutral).
Status badge: "Extreme High/Low", "Approaching High/Low", "Bullish/Neutral/Bearish".
HTF cell (when MTF ON): Higher-timeframe MPO, color-coded vs extremes; updates intrabar, settles at HTF close.
Predicted (when MTF OFF): Simple MPO extrapolation using momentum/accelerationโillustrative only.
Thresholds: Current thrHigh/thrLow (static or adaptive).
Components: ASCII bars + values for PRV, MCD, PDI, SMF.
Market metrics: Volume Ratio (x) and ATR% of price.
Strength: Bar indicator of |MPO โ 50| ร 2.
Confidence: Heuristic gauge (100 in extremes, 70 in warnings, 50 with divergence, else |MPO โ 50|). Convenience only, not probability.
How to read the oscillator
MPO Value (0โ100): A reading of 50 is neutral. Values above ~55 are increasingly bullish (green), while below ~45 are increasingly bearish (red). Think of these as "market pressure".
Extreme Zones: When MPO climbs into the bright orange/red area (above the base-high line, default 70), the chart will display a dot and downward arrow marking that extreme. Traders often treat this as a sign to tighten stops or look for shorts. Similarly, a bright green dot/up-arrow appears when MPO falls below the base-low (30), hinting at a bullish setup.
Heatmap/Candles: If "Pressure Heatmap" is enabled, the background of the oscillator pane will fade green or red depending on MPO. Users can optionally color the price candles by MPO value (gradient candles) to see these extremes on the main chart.
Prediction Zone(optional): A dashed projection line extends the MPO forward by a small number of bars (prediction_bars) using current MPO momentum and acceleration. This is a heuristic extrapolation best used for short horizons (1โ5 bars) to anticipate whether MPO may touch a warning or extreme zone. It is provisional and becomes less reliable with longer projection lengths โ always confirm predicted moves with bar-close MPO and HTF context before acting.
Divergences: When price makes a higher high but EPZ makes a lower high (bearish divergence), the indicator can draw dotted lines and a "Bear Div" tag. The opposite (lower low price, higher EPZ) gives "Bull Div". These signals confirm waning momentum at extremes.
Zones: Warning bands near extremes; Extreme zones beyond thresholds.
Crossovers: MPO rising through 35 suggests easing downside pressure; falling through 65 suggests waning upside pressure.
Dots/arrows: Extreme markers appear on closed bars when confirmation is ON and respect the 5-bar cooldown.
Pre-alert dots (optional): Proximity cues in warning zones; also gated to bar close when confirmation is ON.
Histogram: Distance from neutral (50); highlights strengthening or weakening pressure.
Divergence tags: "Bear Div" = higher price high with lower MPO high; "Bull Div" = lower price low with higher MPO low.
Pressure Heatmap : Layered gradient background that visually highlights pressure strength across the MPO scale; adjustable intensity and optional zone overlays (warning / extreme) for quick visual scanning.
A typical reading: If the oscillator is rising from neutral towards the high zone (greenโorangeโred), the chart may see strong buying culminating in a stall. If it then turns down from the extreme, that peak EPZ dot signals sell pressure.
Alerts
EPZ: Extreme Context โ fires on confirmed extremes (respects cooldown).
EPZ: Approaching Threshold โ fires in warning zones if no extreme.
EPZ: Divergence โ fires on confirmed pivot divergences.
Tip: Set alerts to "Once per bar close" to align with confirmation and avoid intrabar repaint.
Practical usage ideas
Trend continuation: In positive regimes (MPO > 50 and rising), pullbacks holding above 50 often precede continuation; mirror for bearish regimes.
Exhaustion caution: E High/E Low can mark exhaustion risk; many wait for MPO rollover or divergence to time fades or partial exits.
Adaptive thresholds: Useful on assets with shifting volatility regimes to maintain meaningful "extreme" levels.
MTF alignment: Prefer setups that agree with the HTF MPO to reduce countertrend noise.
Examples
Screenshots captured in TradingView Replay to freeze the bar at close so values don't fluctuate intrabar. These examples use default settings and are reproducible on the same bars; they are for illustration, not cherry-picking or performance claims.
Example 1 โ BTCUSDT, 1h โ E Low
MPO closed at 26.6 (below the 30 extreme), printing a confirmed E Low. HTF MPO is 26.6, so higher-timeframe pressure remains bearish. Components are subdued (Momentum/Pressure/Smart$ โ 29โ37), with Vol Ratio โ 1.19x and ATR% โ 0.37%. A prior Bear Div flagged weakening impulse into the drop. With cooldown set to 5 bars, new extremes are rate-limited. Many traders wait for MPO to curl up and reclaim 35 or for a fresh Bull Div before considering countertrend ideas; if MPO cannot reclaim 35 and HTF stays weak, treat bounces cautiously. Educational illustration only.
Example 2 โ ETHUSD, 30m โ E High
A strong impulse pushed MPO into the extreme zone (โฅ 70), printing a confirmed E High on close. Shortly after, MPO cooled to ~61.5 while a Bear Div appeared, showing momentum lag as price pushed a higher high. Volume and volatility were elevated (โ 1.79x / 1.25%). With a 5-bar cooldown, additional extremes won't print immediately. Some treat E High as exhaustion riskโeither waiting for MPO rollover under 65/50 to fade, or for a pullback that holds above 50 to re-join the trend if higher-timeframe pressure remains constructive. Educational illustration only.
Known limitations and caveats
The MPO line itself can change intrabar; extreme markers/alerts do not repaint when "Confirm Extremes on Bar Close" is ON.
HTF values settle at the close of the HTF bar.
Illiquid symbols or very low TFs can be noisy; consider higher thresholds or longer smoothing.
Prediction line (when enabled) is a visual extrapolation only.
For coders
Pine v6. MTF via request.security with lookahead_off.
Extremes include crossover triggers so static thresholds also yield E High/E Low.
Extreme markers and pre-alerts are gated by barstate.isconfirmed when confirmation is ON.
Arrays prune oldest objects to respect resource limits; defaults (80/80/60) are conservative for low TFs.
3D layering uses negative offsets purely for drawing depth (no lookahead).
Screenshot methodology:
To make labels legible and to demonstrate non-repainting behavior, the examples were captured in TradingView Replay with "Confirm Extremes on Bar Close" enabled. Replay is used only to freeze the bar at close so plots don't change intrabar. The examples use default settings, include both Extreme Low and Extreme High cases, and can be reproduced by scrolling to the same bars outside Replay. This is an educational illustration, not a performance claim.
Disclaimer
This script is for educational purposes only and does not constitute financial advice. Markets involve risk; past behavior does not guarantee future results. You are responsible for your own testing, risk management, and decisions.
Cari skrip untuk "high low"
EAOBS by MIGVersion 1
1. Strategy Overview Objective: Capitalize on breakout movements in Ethereum (ETH) price after the Asian open pre-market session (7:00 PMโ7:59 PM EST) by identifying high and low prices during the session and trading breakouts above the high or below the low.
Timeframe: Any (script is timeframe-agnostic, but align with session timing).
Session: Pre-market session (7:00 PMโ7:59 PM EST, adjustable for other time zones, e.g., 12:00 AMโ12:59 AM GMT).
Risk-Reward Ratios (R:R): Targets range from 1.2:1 to 5.2:1, with a fixed stop loss.
Instrument: Ethereum (ETH/USD or ETH-based pairs).
2. Market Setup Session Monitoring: Monitor ETH price action during the pre-market session (7:00 PMโ7:59 PM EST), which aligns with the Asian market open (e.g., 9:00 AMโ9:59 AM JST).
The script tracks the highest high and lowest low during this session.
Breakout Triggers: Buy Signal: Price breaks above the sessionโs high after the session ends (7:59 PM EST).
Sell Signal: Price breaks below the sessionโs low after the session ends.
Visualization: The session is highlighted on the chart with a white background.
Horizontal lines are drawn at the sessionโs high and low, extended for 30 bars, along with take-profit (TP) and stop-loss (SL) levels.
3. Entry Rules Long (Buy) Entry: Enter a long position when the price breaks above the sessionโs high price after 7:59 PM EST.
Entry price: Just above the session high (e.g., add a small buffer, like 0.1โ0.5%, to avoid false breakouts, depending on volatility).
Short (Sell) Entry: Enter a short position when the price breaks below the sessionโs low price after 7:59 PM EST.
Entry price: Just below the session low (e.g., subtract a small buffer, like 0.1โ0.5%).
Confirmation: Use a candlestick close above/below the breakout level to confirm the entry.
Optionally, add volume confirmation or a momentum indicator (e.g., RSI or MACD) to filter out weak breakouts.
Position Size: Calculate position size based on risk tolerance (e.g., 1โ2% of account per trade).
Risk is determined by the stop-loss distance (10 points, as defined in the script).
4. Exit Rules Take-Profit Levels (in points, based on script inputs):TP1: 12 points (1.2:1 R:R).
TP2: 22 points (2.2:1 R:R).
TP3: 32 points (3.2:1 R:R).
TP4: 42 points (4.2:1 R:R).
TP5: 52 points (5.2:1 R:R).
Example for Long: If session high is 3000, TP levels are 3012, 3022, 3032, 3042, 3052.
Example for Short: If session low is 2950, TP levels are 2938, 2928, 2918, 2908, 2898.
Strategy: Scale out of the position (e.g., close 20% at TP1, 20% at TP2, etc.) or take full profit at a preferred TP level based on market conditions.
Stop-Loss: Fixed at 10 points from the entry.
Long SL: Session high - 10 points (e.g., entry at 3000, SL at 2990).
Short SL: Session low + 10 points (e.g., entry at 2950, SL at 2960).
Trailing Stop (Optional):After reaching TP2 or TP3, consider trailing the stop to lock in profits (e.g., trail by 10โ15 points below the current price).
5. Risk Management per Trade: Limit risk to 1โ2% of your trading account per trade.
Calculate position size: Account Size ร Risk % รท (Stop-Loss Distance ร ETH Price per Point).
Example: $10,000 account, 1% risk = $100. If SL = 10 points and 1 point = $1, position size = $100 รท 10 = 0.1 ETH.
Daily Risk Limit: Cap daily losses at 3โ5% of the account to avoid overtrading.
Maximum Exposure: Avoid taking both long and short positions simultaneously unless using separate accounts or strategies.
Volatility Consideration: Adjust position size during high-volatility periods (e.g., major news events like Ethereum upgrades or macroeconomic announcements).
6. Trade Management Monitoring :Watch for breakouts after 7:59 PM EST.
Monitor price action near TP and SL levels using alerts or manual checks.
Trade Duration: Breakout lines extend for 30 bars (script parameter). Close trades if no TP or SL is hit within this period, or reassess based on market conditions.
Adjustments: If the market shows strong momentum, consider holding beyond TP5 with a trailing stop.
If the breakout fails (e.g., price reverses before TP1), exit early to minimize losses.
7. Additional Considerations Market Conditions: The 7:00 PMโ7:59 PM EST session aligns with the Asian market open (e.g., Tokyo Stock Exchange open at 9:00 AM JST), which may introduce higher volatility due to Asian trading activity.
Avoid trading during low-liquidity periods or extreme volatility (e.g., major crypto news).
Check for upcoming events (e.g., Ethereum network upgrades, ETF decisions) that could impact price.
Backtesting: Test the strategy on historical ETH data using the session high/low breakouts for the 7:00 PMโ7:59 PM EST window to validate performance.
Adjust TP/SL levels based on backtest results if needed.
Broker and Fees: Use a low-fee crypto exchange (e.g., Binance, Kraken, Coinbase Pro) to maximize R:R.
Account for trading fees and slippage in your position sizing.
Time zone Adjustment: Adjust session time input for your time zone (e.g., "0000-0059" for GMT).
Ensure your trading platformโs clock aligns with the scriptโs time zone (default: America/New_York).
8. Example Trade Scenario: Session (7:00 PMโ7:59 PM EST) records a high of 3050 and a low of 3000.
Long Trade: Entry: Price breaks above 3050 (e.g., enter at 3051).
TP Levels: 3063 (TP1), 3073 (TP2), 3083 (TP3), 3093 (TP4), 3103 (TP5).
SL: 3040 (3050 - 10).
Position Size: For a $10,000 account, 1% risk = $100. SL = 11 points ($11). Size = $100 รท 11 = ~0.09 ETH.
Short Trade: Entry: Price breaks below 3000 (e.g., enter at 2999).
TP Levels: 2987 (TP1), 2977 (TP2), 2967 (TP3), 2957 (TP4), 2947 (TP5).
SL: 3010 (3000 + 10).
Position Size: Same as above, ~0.09 ETH.
Execution: Set alerts for breakouts, enter with limit orders, and monitor TPs/SL.
9. Tools and Setup Platform: Use TradingView to implement the Pine Script and visualize breakout levels.
Alerts: Set price alerts for breakouts above the session high or below the session low after 7:59 PM EST.
Set alerts for TP and SL levels.
Chart Settings: Use a 1-minute or 5-minute chart for precise session tracking.
Overlay the script to see high/low lines, TP levels, and SL levels.
Optional Indicators: Add RSI (e.g., avoid overbought/oversold breakouts) or volume to confirm breakouts.
10. Risk Warnings Crypto Volatility: ETH is highly volatile; unexpected news can cause rapid price swings.
False Breakouts: Breakouts may fail, especially in low-volume sessions. Use confirmation signals.
Leverage: Avoid high leverage (e.g., >5x) to prevent liquidation during volatile moves.
Session Accuracy: Ensure correct session timing for your time zone to avoid misaligned entries.
11. Performance Tracking Journaling :Record each tradeโs entry, exit, R:R, and outcome.
Note market conditions (e.g., trending, ranging, news-driven).
Review: Weekly: Assess win rate, average R:R, and adherence to the plan.
Monthly: Adjust TP/SL or session timing based on performance.
Custom ZigZag IndicatorOverview
The Custom ZigZag Indicator is a technical analysis tool built in Pine Script (version 5) for TradingView. It overlays on price charts to visualize market trends by connecting significant swing highs and lows, filtering out minor price noise. This helps identify the overall market direction (uptrends or downtrends), potential reversal points, and key support/resistance levels. Unlike standard price lines, it "zigzags" only between meaningful pivots, making trends clearer.
Core Logic and How It Works
The script uses a state-machine approach to track market direction and pivots:
Initialization
Starts assuming an upward trend on the first bar.
sets initial high/low prices and bar indices based on the current bar's high/low.
Direction Tracking:
Upward Trend (direction = 1):
Monitors for new highs: If the current high exceeds the tracked high, update the high price and bar.
Checks for reversal: If the low drops below the high by the deviation percentage (e.g., high * (1 - 0.05) for 5%), it signals a downtrend reversal.
Draws a green line from the last pivot (low) to the new high.
If labels are enabled, adds a label: "HH" (Higher High if above previous high), "LH" (Lower High if below), or "H" (for the first one).
Updates the last high and switches to downward direction.
Downward Trend (direction = -1):
Monitors for new lows: If the current low is below the tracked low, update the low price and bar.
Checks for reversal: If the high rises above the low by the deviation percentage (e.g., low * (1 + 0.05)), it signals an uptrend reversal.
Draws a red line from the last pivot (high) to the new low.
If labels are enabled, adds a label: "LL" (Lower Low if below previous low), "HL" (Higher Low if above), or "L" (for the first one).
Updates the last low and switches to upward direction.
Initial balance - weeklyWeekly Initial Balance (IB) โ Indicator Description
The Weekly Initial Balance (IB) is the price range (HighโLow) established during the weekโs first trading session (most commonly Monday). You can measure it over the entire day or just the first X hours (e.g. 60 or 120 minutes). Once that session ends, the IB High and IB Low define the key levels where the initial weekly range formed.
Why Measure the Weekly IB?
Week-Opening Sentiment:
Mondayโs range often sets the tone for the rest of the week. Trading above the IB High signals bullish control; trading below the IB Low signals bearish control.
Key Liquidity Zones:
Large institutions tend to place orders around these extremes, so youโll frequently see tests, breakouts, or rejections at these levels.
Support & Resistance:
The IB High and IB Low become natural barriers. Price will often return to them, bounce off them, or break through themโideal spots for entries and exits.
Volatility Forecast:
The width of the IB (High minus Low) indicates whether to expect a volatile week (wide IB) or a quieter one (narrow IB).
Significance of IB Levels
Breakout:
A clear break above the IB High (for longs) or below the IB Low (for shorts) can ignite a strong trending move.
Fade:
A rejection off the IB High/Low during low momentum (e.g. low volume or pin-bar formations) offers a high-probability reversal trade.
Mid-Point:
The 50% level of the IB range often โmagnetizesโ price back to it, providing entry points for continuation or reversal strategies.
Three Core Monday IB Strategies
A. Breakout (Open-Range Breakout)
Entry: Wait for 1โ2 candles (e.g. 5-minute) to close above IB High (long) or below IB Low (short).
Stop-Loss: A few pips below IB High (long) or above IB Low (short).
Profit-Target: 2โ3ร your risk (Reward:Risk โฅ 2:1).
Best When: You spot a clear impulseโsuch as a strong pre-open volume spike or news-driven move.
B. Fade (Reversal at Extremes)
Entry: When price tests IB High but shows weakening momentum (shrinking volume, upper-wick candles), enter short; vice versa for IB Low and longs.
Stop-Loss: Just beyond the IB extreme youโre fading.
Profit-Target: Back toward the IB mid-point (50% level) or all the way to the opposite IB extreme.
Best When: Mondayโs action is range-bound and lacks a clear directional trend.
C. Mid-Point Trading
Entry: When price returns to the 50% level of the IB range.
In an up-trend: buy if it bounces off mid-point back toward IB High.
In a down-trend: sell if it reverses off mid-point back toward IB Low.
Stop-Loss: Just below the nearest swing-low (for longs) or above the nearest swing-high (for shorts).
Profit-Target: To the corresponding IB extreme (High or Low).
Best When: You see a strong initial move away from the IB, followed by a pullback to the mid-point.
Usage Steps
Configure your session: Measure IB over your chosen Monday timeframe (whole day or first X hours).
Choose your strategy: Align Breakout, Fade, or Mid-Point entries with the current market context (trend vs. range).
Manage risk: Keep risk per trade โค 1% of account and maintain at least a 2:1 Reward:Risk ratio.
Backtest & forward-test: Verify performance over multiple Mondays and in a paper-trading environment before going live.
Trend Gauge [BullByte]Trend Gauge
Summary
A multi-factor trend detection indicator that aggregates EMA alignment, VWMA momentum scaling, volume spikes, ATR breakout strength, higher-timeframe confirmation, ADX-based regime filtering, and RSI pivot-divergence penalty into one normalized trend score. It also provides a confidence meter, a ฮ Score momentum histogram, divergence highlights, and a compact, scalable dashboard for at-a-glance status.
________________________________________
## 1. Purpose of the Indicator
Why this was built
Traders often monitor several indicators in parallel - EMAs, volume signals, volatility breakouts, higher-timeframe trends, ADX readings, divergence alerts, etc., which can be cumbersome and sometimes contradictory. The โTrend Gaugeโ indicator was created to consolidate these complementary checks into a single, normalized score that reflects the prevailing market bias (bullish, bearish, or neutral) and its strength. By combining multiple inputs with an adaptive regime filter, scaling contributions by magnitude, and penalizing weakening signals (divergence), this tool aims to reduce noise, highlight genuine trend opportunities, and warn when momentum fades.
Key Design Goals
Signal Aggregation
Merged trend-following signals (EMA crossover, ATR breakout, higher-timeframe confirmation) and momentum signals (VWMA thrust, volume spikes) into a unified score that reflects directional bias more holistically.
Market Regime Awareness
Implemented an ADX-style filter to distinguish between trending and ranging markets, reducing the influence of trend signals during sideways phases to avoid false breakouts.
Magnitude-Based Scaling
Replaced binary contributions with scaled inputs: VWMA thrust and ATR breakout are weighted relative to recent averages, allowing for more nuanced score adjustments based on signal strength.
Momentum Divergence Penalty
Integrated pivot-based RSI divergence detection to slightly reduce the overall score when early signs of momentum weakening are detected, improving risk-awareness in entries.
Confidence Transparency
Added a live confidence metric that shows what percentage of enabled sub-indicators currently agree with the overall bias, making the scoring system more interpretable.
Momentum Acceleration Visualization
Plotted the change in score (ฮ Score) as a histogram bar-to-bar, highlighting whether momentum is increasing, flattening, or reversing, aiding in more timely decision-making.
Compact Informational Dashboard
Presented a clean, scalable dashboard that displays each componentโs status, the final score, confidence %, detected regime (Trending/Ranging), and a labeled strength gauge for quick visual assessment.
________________________________________
## 2. Why a Trader Should Use It
Main benefits and use cases
1. Unified View: Rather than juggling multiple windows or panels, this indicator delivers a single score synthesizing diverse signals.
2. Regime Filtering: In ranging markets, trend signals often generate false entries. The ADX-based regime filter automatically down-weights trend-following components, helping you avoid chasing false breakouts.
3. Nuanced Momentum & Volatility: VWMA and ATR breakout contributions are normalized by recent averages, so strong moves register strongly while smaller fluctuations are de-emphasized.
4. Early Warning of Weakening: Pivot-based RSI divergence is detected and used to slightly reduce the score when price/momentum diverges, giving a cautionary signal before a full reversal.
5. Confidence Meter: See at a glance how many sub-indicators align with the aggregated bias (e.g., โ80% confidenceโ means 4 out of 5 components agree ). This transparency avoids black-box decisions.
6. Trend Acceleration/Deceleration View: The ฮ Score histogram visualizes whether the aggregated score is rising (accelerating trend) or falling (momentum fading), supplementing the main oscillator.
7. Compact Dashboard: A corner table lists each checkโs status (โBullโ, โBearโ, โFlatโ or โDisabledโ), plus overall Score, Confidence %, Regime, Trend Strength label, and a gauge bar. Users can scale text size (Normal, Small, Tiny) without removing elements, so the full picture remains visible even in compact layouts.
8. Customizable & Transparent: All components can be enabled/disabled and parameterized (lengths, thresholds, weights). The full Pine code is open and well-commented, letting users inspect or adapt the logic.
9. Alert-ready: Built-in alert conditions fire when the score crosses weak thresholds to bullish/bearish or returns to neutral, enabling timely notifications.
________________________________________
## 3. Component Rationale (โWhy These Specific Indicators?โ)
Each sub-component was chosen because it adds complementary information about trend or momentum:
1. EMA Cross
o Basic trend measure: compares a faster EMA vs. a slower EMA. Quickly reflects trend shifts but by itself can whipsaw in sideways markets.
2. VWMA Momentum
o Volume-weighted moving average change indicates momentum with volume context. By normalizing (dividing by a recent average absolute change), we capture the strength of momentum relative to recent history. This scaling prevents tiny moves from dominating and highlights genuinely strong momentum.
3. Volume Spikes
o Sudden jumps in volume combined with price movement often accompany stronger moves or reversals. A binary detection (+1 for bullish spike, -1 for bearish spike) flags high-conviction bars.
4. ATR Breakout
o Detects price breaking beyond recent highs/lows by a multiple of ATR. Measures breakout strength by how far beyond the threshold price moves relative to ATR, capped to avoid extreme outliers. This gives a volatility-contextual trend signal.
5. Higher-Timeframe EMA Alignment
o Confirms whether the shorter-term trend aligns with a higher timeframe trend. Uses request.security with lookahead_off to avoid future data. When multiple timeframes agree, confidence in direction increases.
6. ADX Regime Filter (Manual Calculation)
o Computes directional movement (+DM/โDM), smoothes via RMA, computes DI+ and DIโ, then a DX and ADX-like value. If ADX โฅ threshold, market is โTrendingโ and trend components carry full weight; if ADX < threshold, โRangingโ mode applies a configurable weight multiplier (e.g., 0.5) to trend-based contributions, reducing false signals in sideways conditions. Volume spikes remain binary (optional behavior; can be adjusted if desired).
7. RSI Pivot-Divergence Penalty
o Uses ta.pivothigh / ta.pivotlow with a lookback to detect pivot highs/lows on price and corresponding RSI values. When price makes a higher high but RSI makes a lower high (bearish divergence), or price makes a lower low but RSI makes a higher low (bullish divergence), a divergence signal is set. Rather than flipping the trend outright, the indicator subtracts (or adds) a small penalty (configurable) from the aggregated score if it would weaken the current bias. This subtle adjustment warns of weakening momentum without overreacting to noise.
8. Confidence Meter
o Counts how many enabled components currently agree in direction with the aggregated score (i.e., component sign ร score sign > 0). Displays this as a percentage. A high percentage indicates strong corroboration; a low percentage warns of mixed signals.
9. ฮ Score Momentum View
o Plots the bar-to-bar change in the aggregated score (delta_score = score - score ) as a histogram. When positive, bars are drawn in green above zero; when negative, bars are drawn in red below zero. This reveals acceleration (rising ฮ) or deceleration (falling ฮ), supplementing the main oscillator.
10. Dashboard
โข A table in the indicator paneโs top-right with 11 rows:
1. EMA Cross status
2. VWMA Momentum status
3. Volume Spike status
4. ATR Breakout status
5. Higher-Timeframe Trend status
6. Score (numeric)
7. Confidence %
8. Regime (โTrendingโ or โRangingโ)
9. Trend Strength label (e.g., โWeak Bullish Trendโ, โStrong Bearish Trendโ)
10. Gauge bar visually representing score magnitude
โข All rows always present; size_opt (Normal, Small, Tiny) only changes text size via text_size, not which elements appear. This ensures full transparency.
________________________________________
## 4. What Makes This Indicator Stand Out
โข Regime-Weighted Multi-Factor Score: Trend and momentum signals are adaptively weighted by market regime (trending vs. ranging) , reducing false signals.
โข Magnitude Scaling: VWMA and ATR breakout contributions are normalized by recent average momentum or ATR, giving finer gradation compared to simple ยฑ1.
โข Integrated Divergence Penalty: Divergence directly adjusts the aggregated score rather than appearing as a separate subplot; this influences alerts and trend labeling in real time.
โข Confidence Meter: Shows the percentage of sub-signals in agreement, providing transparency and preventing blind trust in a single metric.
โข ฮ Score Histogram Momentum View: A histogram highlights acceleration or deceleration of the aggregated trend score, helping detect shifts early.
โข Flexible Dashboard: Always-visible component statuses and summary metrics in one place; text size scaling keeps the full picture available in cramped layouts.
โข Lookahead-Safe HTF Confirmation: Uses lookahead_off so no future data is accessed from higher timeframes, avoiding repaint bias.
โข Repaint Transparency: Divergence detection uses pivot functions that inherently confirm only after lookback bars; description documents this lag so users understand how and when divergence labels appear.
โข Open-Source & Educational: Full, well-commented Pine v6 code is provided; users can learn from its structure: manual ADX computation, conditional plotting with series = show ? value : na, efficient use of table.new in barstate.islast, and grouped inputs with tooltips.
โข Compliance-Conscious: All plots have descriptive titles; inputs use clear names; no unnamed generic โPlotโ entries; manual ADX uses RMA; all request.security calls use lookahead_off. Code comments mention repaint behavior and limitations.
________________________________________
## 5. Recommended Timeframes & Tuning
โข Any Timeframe: The indicator works on small (e.g., 1m) to large (daily, weekly) timeframes. However:
o On very low timeframes (<1m or tick charts), noise may produce frequent whipsaws. Consider increasing smoothing lengths, disabling certain components (e.g., volume spike if volume data noisy), or using a larger pivot lookback for divergence.
o On higher timeframes (daily, weekly), consider longer lookbacks for ATR breakout or divergence, and set Higher-Timeframe trend appropriately (e.g., 4H HTF when on 5 Min chart).
โข Defaults & Experimentation: Default input values are chosen to be balanced for many liquid markets. Users should test with replay or historical analysis on their symbol/timeframe and adjust:
o ADX threshold (e.g., 20โ30) based on instrument volatility.
o VWMA and ATR scaling lengths to match average volatility cycles.
o Pivot lookback for divergence: shorter for faster markets, longer for slower ones.
โข Combining with Other Analysis: Use in conjunction with price action, support/resistance, candlestick patterns, order flow, or other tools as desired. The aggregated score and alerts can guide attention but should not be the sole decision-factor.
________________________________________
## 6. How Scoring and Logic Works (Step-by-Step)
1. Compute Sub-Scores
o EMA Cross: Evaluate fast EMA > slow EMA ? +1 : fast EMA < slow EMA ? -1 : 0.
o VWMA Momentum: Calculate vwma = ta.vwma(close, length), then vwma_mom = vwma - vwma . Normalize: divide by recent average absolute momentum (e.g., ta.sma(abs(vwma_mom), lookback)), clip to .
o Volume Spike: Compute vol_SMA = ta.sma(volume, len). If volume > vol_SMA * multiplier AND price moved up โฅ threshold%, assign +1; if moved down โฅ threshold%, assign -1; else 0.
o ATR Breakout: Determine recent high/low over lookback. If close > high + ATR*mult, compute distance = close - (high + ATR*mult), normalize by ATR, cap at a configured maximum. Assign positive contribution. Similarly for bearish breakout below low.
o Higher-Timeframe Trend: Use request.security(..., lookahead=barmerge.lookahead_off) to fetch HTF EMAs; assign +1 or -1 based on alignment.
2. ADX Regime Weighting
o Compute manual ADX: directional movements (+DM, โDM), smoothed via RMA, DI+ and DIโ, then DX and ADX via RMA. If ADX โฅ threshold, market is considered โTrendingโ; otherwise โRanging.โ
o If trending, trend-based contributions (EMA, VWMA, ATR, HTF) use full weight = 1.0. If ranging, use weight = ranging_weight (e.g., 0.5) to down-weight them. Volume spike stays binary ยฑ1 (optional to change if desired).
3. Aggregate Raw Score
o Sum weighted contributions of all enabled components. Count the number of enabled components; if zero, default count = 1 to avoid division by zero.
4. Divergence Penalty
o Detect pivot highs/lows on price and corresponding RSI values, using a lookback. When price and RSI diverge (bearish or bullish divergence), check if current raw score is in the opposing direction:
๏ง If bearish divergence (price higher high, RSI lower high) and raw score currently positive, subtract a penalty (e.g., 0.5).
๏ง If bullish divergence (price lower low, RSI higher low) and raw score currently negative, add a penalty.
o This reduces score magnitude to reflect weakening momentum, without flipping the trend outright.
5. Normalize and Smooth
o Normalized score = (raw_score / number_of_enabled_components) * 100. This yields a roughly range.
o Optional EMA smoothing of this normalized score to reduce noise.
6. Interpretation
o Sign: >0 = net bullish bias; <0 = net bearish bias; near zero = neutral.
o Magnitude Zones: Compare |score| to thresholds (Weak, Medium, Strong) to label trend strength (e.g., โWeak Bullish Trendโ, โMedium Bearish Trendโ, โStrong Bullish Trendโ).
o ฮ Score Histogram: The histogram bars from zero show change from previous barโs score; positive bars indicate acceleration, negative bars indicate deceleration.
o Confidence: Percentage of sub-indicators aligned with the scoreโs sign.
o Regime: Indicates whether trend-based signals are fully weighted or down-weighted.
________________________________________
## 7. Oscillator Plot & Visualization: How to Read It
Main Score Line & Area
The oscillator plots the aggregated score as a line, with colored fill: green above zero for bullish area, red below zero for bearish area. Horizontal reference lines at ยฑWeak, ยฑMedium, and ยฑStrong thresholds mark zones: crossing above +Weak suggests beginning of bullish bias, above +Medium for moderate strength, above +Strong for strong trend; similarly for bearish below negative thresholds.
ฮ Score Histogram
If enabled, a histogram shows score - score . When positive, bars appear in green above zero, indicating accelerating bullish momentum; when negative, bars appear in red below zero, indicating decelerating or reversing momentum. The height of each bar reflects the magnitude of change in the aggregated score from the prior bar.
Divergence Highlight Fill
If enabled, when a pivot-based divergence is confirmed:
โข Bullish Divergence : fill the area below zero down to โWeak threshold in green, signaling potential reversal from bearish to bullish.
โข Bearish Divergence : fill the area above zero up to +Weak threshold in red, signaling potential reversal from bullish to bearish.
These fills appear with a lag equal to pivot lookback (the number of bars needed to confirm the pivot). They do not repaint after confirmation, but users must understand this lag.
Trend Direction Label
When score crosses above or below the Weak threshold, a small label appears near the score line reading โBullishโ or โBearish.โ If the score returns within ยฑWeak, the label โNeutralโ appears. This helps quickly identify shifts at the moment they occur.
Dashboard Panel
In the indicator paneโs top-right, a table shows:
1. EMA Cross status: โBullโ, โBearโ, โFlatโ, or โDisabledโ
2. VWMA Momentum status: similarly
3. Volume Spike status: โBullโ, โBearโ, โNoโ, or โDisabledโ
4. ATR Breakout status: โBullโ, โBearโ, โNoโ, or โDisabledโ
5. Higher-Timeframe Trend status: โBullโ, โBearโ, โFlatโ, or โDisabledโ
6. Score: numeric value (rounded)
7. Confidence: e.g., โ80%โ (colored: green for high, amber for medium, red for low)
8. Regime: โTrendingโ or โRangingโ (colored accordingly)
9. Trend Strength: textual label based on magnitude (e.g., โMedium Bullish Trendโ)
10. Gauge: a bar of blocks representing |score|/100
All rows remain visible at all times; changing Dashboard Size only scales text size (Normal, Small, Tiny).
________________________________________
## 8. Example Usage (Illustrative Scenario)
Example: BTCUSD 5 Min
1. Setup: Add โTrend Gauge โ to your BTCUSD 5 Min chart. Defaults: EMAs (8/21), VWMA 14 with lookback 3, volume spike settings, ATR breakout 14/5, HTF = 5m (or adjust to 4H if preferred), ADX threshold 25, ranging weight 0.5, divergence RSI length 14 pivot lookback 5, penalty 0.5, smoothing length 3, thresholds Weak=20, Medium=50, Strong=80. Dashboard Size = Small.
2. Trend Onset: At some point, price breaks above recent high by ATR multiple, volume spikes upward, faster EMA crosses above slower EMA, HTF EMA also bullish, and ADX (manual) โฅ threshold โ aggregated score rises above +20 (Weak threshold) into +Medium zone. Dashboard shows โBullโ for EMA, VWMA, Vol Spike, ATR, HTF; Score ~+60โ+70; Confidence ~100%; Regime โTrendingโ; Trend Strength โMedium Bullish Trendโ; Gauge ~6โ7 blocks. ฮ Score histogram bars are green and rising, indicating accelerating bullish momentum. Trader notes the alignment.
3. Divergence Warning: Later, price makes a slightly higher high but RSI fails to confirm (lower RSI high). Pivot lookback completes; the indicator highlights a bearish divergence fill above zero and subtracts a small penalty from the score, causing score to stall or retrace slightly. Dashboard still bullish but score dips toward +Weak. This warns the trader to tighten stops or take partial profits.
4. Trend Weakens: Score eventually crosses below +Weak back into neutral; a โNeutralโ label appears, and a โNeutral Trendโ alert fires if enabled. Trader exits or avoids new long entries. If score subsequently crosses below โWeak, a โBearishโ label and alert occur.
5. Customization: If the trader finds VWMA noise too frequent on this instrument, they may disable VWMA or increase lookback. If ATR breakouts are too rare, adjust ATR length or multiplier. If ADX threshold seems off, tune threshold. All these adjustments are explained in Inputs section.
6. Visualization: The screenshot shows the main score oscillator with colored areas, reference lines at ยฑ20/50/80, ฮ Score histogram bars below/above zero, divergence fill highlighting potential reversal, and the dashboard table in the top-right.
________________________________________
## 9. Inputs Explanation
A concise yet clear summary of inputs helps users understand and adjust:
1. General Settings
โข Theme (Dark/Light): Choose background-appropriate colors for the indicator pane.
โข Dashboard Size (Normal/Small/Tiny): Scales text size only; all dashboard elements remain visible.
2. Indicator Settings
โข Enable EMA Cross: Toggle on/off basic EMA alignment check.
o Fast EMA Length and Slow EMA Length: Periods for EMAs.
โข Enable VWMA Momentum: Toggle VWMA momentum check.
o VWMA Length: Period for VWMA.
o VWMA Momentum Lookback: Bars to compare VWMA to measure momentum.
โข Enable Volume Spike: Toggle volume spike detection.
o Volume SMA Length: Period to compute average volume.
o Volume Spike Multiplier: How many times above average volume qualifies as spike.
o Min Price Move (%): Minimum percent change in price during spike to qualify as bullish or bearish.
โข Enable ATR Breakout: Toggle ATR breakout detection.
o ATR Length: Period for ATR.
o Breakout Lookback: Bars to look back for recent highs/lows.
o ATR Multiplier: Multiplier for breakout threshold.
โข Enable Higher Timeframe Trend: Toggle HTF EMA alignment.
o Higher Timeframe: E.g., โ5โ for 5-minute when on 1-minute chart, or โ60โ for 5 Min when on 15m, etc. Uses lookahead_off.
โข Enable ADX Regime Filter: Toggles regime-based weighting.
o ADX Length: Period for manual ADX calculation.
o ADX Threshold: Value above which market considered trending.
o Ranging Weight Multiplier: Weight applied to trend components when ADX < threshold (e.g., 0.5).
โข Scale VWMA Momentum: Toggle normalization of VWMA momentum magnitude.
o VWMA Mom Scale Lookback: Period for average absolute VWMA momentum.
โข Scale ATR Breakout Strength: Toggle normalization of breakout distance by ATR.
o ATR Scale Cap: Maximum multiple of ATR used for breakout strength.
โข Enable Price-RSI Divergence: Toggle divergence detection.
o RSI Length for Divergence: Period for RSI.
o Pivot Lookback for Divergence: Bars on each side to identify pivot high/low.
o Divergence Penalty: Amount to subtract/add to score when divergence detected (e.g., 0.5).
3. Score Settings
โข Smooth Score: Toggle EMA smoothing of normalized score.
โข Score Smoothing Length: Period for smoothing EMA.
โข Weak Threshold: Absolute score value under which trend is considered weak or neutral.
โข Medium Threshold: Score above Weak but below Medium is moderate.
โข Strong Threshold: Score above this indicates strong trend.
4. Visualization Settings
โข Show ฮ Score Histogram: Toggle display of the bar-to-bar change in score as a histogram. Default true.
โข Show Divergence Fill: Toggle background fill highlighting confirmed divergences. Default true.
Each input has a tooltip in the code.
________________________________________
## 10. Limitations, Repaint Notes, and Disclaimers
10.1. Repaint & Lag Considerations
โข Pivot-Based Divergence Lag: The divergence detection uses ta.pivothigh / ta.pivotlow with a specified lookback. By design, a pivot is only confirmed after the lookback number of bars. As a result:
o Divergence labels or fills appear with a delay equal to the pivot lookback.
o Once the pivot is confirmed and the divergence is detected, the fill/label does not repaint thereafter, but you must understand and accept this lag.
o Users should not treat divergence highlights as predictive signals without additional confirmation, because they appear after the pivot has fully formed.
โข Higher-Timeframe EMA Alignment: Uses request.security(..., lookahead=barmerge.lookahead_off), so no future data from the higher timeframe is used. This avoids lookahead bias and ensures signals are based only on completed higher-timeframe bars.
โข No Future Data: All calculations are designed to avoid using future information. For example, manual ADX uses RMA on past data; security calls use lookahead_off.
10.2. Market & Noise Considerations
โข In very choppy or low-liquidity markets, some components (e.g., volume spikes or VWMA momentum) may be noisy. Users can disable or adjust those componentsโ parameters.
โข On extremely low timeframes, noise may dominate; consider smoothing lengths or disabling certain features.
โข On very high timeframes, pivots and breakouts occur less frequently; adjust lookbacks accordingly to avoid sparse signals.
10.3. Not a Standalone Trading System
โข This is an indicator, not a complete trading strategy. It provides signals and context but does not manage entries, exits, position sizing, or risk management.
โข Users must combine it with their own analysis, money management, and confirmations (e.g., price patterns, support/resistance, fundamental context).
โข No guarantees: past behavior does not guarantee future performance.
10.4. Disclaimers
โข Educational Purposes Only: The script is provided as-is for educational and informational purposes. It does not constitute financial, investment, or trading advice.
โข Use at Your Own Risk: Trading involves risk of loss. Users should thoroughly test and use proper risk management.
โข No Guarantees: The author is not responsible for trading outcomes based on this indicator.
โข License: Published under Mozilla Public License 2.0; code is open for viewing and modification under MPL terms.
________________________________________
## 11. Alerts
โข The indicator defines three alert conditions:
1. Bullish Trend: when the aggregated score crosses above the Weak threshold.
2. Bearish Trend: when the score crosses below the negative Weak threshold.
3. Neutral Trend: when the score returns within ยฑWeak after being outside.
Good luck
โ BullByte
beanBean's Multi-Instrument Pattern Scanner.
This indicator scans H1 timeframe for specific technical patterns. Here's how each pattern is detected:
PATTERN DETECTION CRITERIA:
1. Hammer
- Body Size: โค 30% of total candle length
- Lower Wick: > 50% of total candle length
- Upper Wick: < 20% of total candle length
- Formula:
* bodySize = |close - open|
* upperWick = high - max(open, close)
* lowerWick = min(open, close) - low
* totalLength = high - low
2. Shooting Star
- Body Size: โค 30% of total candle length
- Upper Wick: > 50% of total candle length
- Lower Wick: < 20% of total candle length
- Uses same measurements as Hammer but inverted
3. Outside/Inside (OI)
Checks three consecutive bars:
- Outside Bar: Bar2 high โฅ Bar3 high AND Bar2 low โค Bar3 low
- Inside Bar: Bar1 high โค Bar2 high AND Bar1 low โฅ Bar2 low
Pattern confirms when both conditions are met
4. Bullish/Bearish Umbrella
Checks two consecutive bars:
Bullish:
- Current bar's high โค previous bar's high
- Current body high โค previous bar's high
- Current body low โฅ previous body high
Bearish:
- Current bar's low โฅ previous bar's low
- Current body low โฅ previous bar's low
- Current body high โค previous body low
5. Three Bar Triangle (3BT)
Checks three consecutive bars:
- Current bar's high โค max(previous two highs)
- Current bar's low โฅ min(previous two lows)
- Indicates price compression
DISPLAY AND ALERTS:
- Patterns are displayed in real-time in the table
- Multiple patterns can be detected simultaneously
- Pattern detection resets each new H1 candle
CONFIGURATION:
- Each row can be independently configured
- Patterns are checked on H1 timeframe close
- Alert frequency: Once per H1 bar close
Note: All measurements use standard OHLC values from only completed H1 candles.
Weekly H/L DOTWThe Weekly High/Low Day Breakdown indicator provides a detailed statistical analysis of the days of the week (Monday to Sunday) on which weekly highs and lows occur for a given timeframe. It helps traders identify recurring patterns, correlations, and tendencies in price behavior across different days of the week. This can assist in planning trading strategies by leveraging day-specific patterns.
The indicator visually displays the statistical distribution of weekly highs and lows in an easy-to-read tabular format on your chart. Users can customize how the data is displayed, including whether the table is horizontal or vertical, the size of the text, and the position of the table on the chart.
Key Features:
Weekly Highs and Lows Identification:
Tracks the highest and lowest price of each trading week.
Records the day of the week on which these events occur.
Customizable Table Layout:
Option to display the table horizontally or vertically.
Text size can be adjusted (Small, Normal, or Large).
Table position is customizable (top-right, top-left, bottom-right, or bottom-left of the chart).
Flexible Value Representation:
Allows the display of values as percentages or as occurrences.
Default setting is occurrences, but users can toggle to percentages as needed.
Day-Specific Display:
Option to hide Saturday or Sunday if these days are not relevant to your trading strategy.
Visible Date Range:
Users can define a start and end date for the analysis, focusing the results on a specific period of interest.
User-Friendly Interface:
The table dynamically updates based on the selected timeframe and visibility of the chart, ensuring the displayed data is always relevant to the current context.
Adaptable to Custom Needs:
Includes all-day names from Monday to Sunday, but allows for specific days to be excluded based on the userโs preferences.
Indicator Logic:
Data Collection:
The indicator collects daily high, low, day of the week, and time data from the selected ticker using the request.security() function with a daily timeframe ('D').
Weekly Tracking:
Tracks the start and end times of each week.
During each week, it monitors the highest and lowest prices and the days they occurred.
Weekly Closure:
When a week ends (detected by Sundayโs daily candle), the indicator:
Updates the statistics for the respective days of the week where the weekly high and low occurred.
Resets tracking variables for the next week.
Visible Range Filter:
Only processes data for weeks that fall within the visible range of the chart, ensuring the table reflects only the visible portion of the chart.
Statistical Calculations:
Counts the number of weekly highs and lows for each day.
Calculates percentages relative to the total number of weeks in the visible range.
Dynamic Table Display:
Depending on user preferences, displays the data either horizontally or vertically.
Formats the table with proper alignment, colors, and text sizes for easy readability.
Custom Value Representation:
If set to "percentages," displays the percentage of weeks a high/low occurred on each day.
If set to "occurrences," displays the raw count of weekly highs/lows for each day.
Input Parameters:
High Text Color:
Color for the text in the "Weekly High" row or column.
Low Text Color:
Color for the text in the "Weekly Low" row or column.
High Background Color:
Background color for the "Weekly High" row or column.
Low Background Color:
Background color for the "Weekly Low" row or column.
Table Background Color:
General background color for the table.
Hide Saturday:
Option to exclude Saturday from the analysis and table.
Hide Sunday:
Option to exclude Sunday from the analysis and table.
Values Format:
Dropdown menu to select "percentages" or "occurrences."
Default value: "occurrences."
Table Position:
Dropdown menu to select the table position on the chart: "top_right," "top_left," "bottom_right," "bottom_left."
Default value: "top_right."
Text Size:
Dropdown menu to select text size: "Small," "Normal," "Large."
Default value: "Normal."
Vertical Table Format:
Checkbox to toggle the table layout:
Checked: Table displays days vertically, with Monday at the top.
Unchecked: Table displays days horizontally.
Start Date:
Allows users to specify the starting date for the analysis.
End Date:
Allows users to specify the ending date for the analysis.
Use Cases:
Day-Specific Pattern Recognition:
Identify if specific days, such as Monday or Friday, are more likely to form weekly highs or lows.
Seasonal Analysis:
Use the start and end date filters to analyze patterns during specific trading seasons.
Strategy Development:
Plan day-based entry and exit strategies by identifying recurring patterns in weekly highs/lows.
Historical Review:
Study historical data to understand how market behavior has changed over time.
TradingView TOS Compliance Notes:
Originality:
This script is uniquely designed to provide day-based statistics for weekly highs and lows, which is not a common feature in other publicly available indicators.
Usefulness:
Offers practical insights for traders interested in understanding day-specific price behavior.
Detailed Description:
Fully explains the purpose, features, logic, input settings, and use cases of the indicator.
Includes clear and concise details on how each input works.
Clear Input Descriptions:
All input parameters are clearly named and explained in the script and this description.
No Redundant Functionality:
Focused specifically on tracking weekly highs and lows, ensuring the indicator serves a distinct purpose without unnecessary features.
Inner Bar Strength (IBS)Inner Bar Strength (IBS) Indicator
The Inner Bar Strength (IBS) indicator is a technical analysis tool designed to measure the position of the closing price relative to the day's price range. It provides insights into market sentiment by indicating where the close occurs within the high and low of a specific timeframe. The IBS value ranges from 0 to 1, where values near 1 suggest bullish momentum (close near the high), and values near 0 indicate bearish momentum (close near the low).
How It Works
The IBS is calculated using the following formula:
IBS = (CloseโLow) / (HighโLow)
IBS = (HighโLow) / (CloseโLowโ)
Close: Closing price of the selected timeframe.
Low: Lowest price of the selected timeframe.
High: Highest price of the selected timeframe.
The indicator allows you to select the timeframe for calculation (default is daily), providing flexibility to analyze different periods based on your trading strategy.
Key Features
Inner Bar Strength (IBS) Indicator
The Inner Bar Strength (IBS) indicator is a technical analysis tool designed to measure the position of the closing price relative to the day's price range. It provides insights into market sentiment by indicating where the close occurs within the high and low of a specific timeframe. The IBS value ranges from 0 to 1, where values near 1 suggest bullish momentum (close near the high), and values near 0 indicate bearish momentum (close near the low).
How It Works
The IBS is calculated using the following formula:
IBS=CloseโLowHighโLow
IBS=HighโLowCloseโLowโ
Close: Closing price of the selected timeframe.
Low: Lowest price of the selected timeframe.
High: Highest price of the selected timeframe.
The indicator allows you to select the timeframe for calculation (default is daily), providing flexibility to analyze different periods based on your trading strategy.
Key Features
Timeframe Selection: Customize the timeframe to daily, weekly, monthly, or any other period that suits your analysis.
Adjustable Thresholds: Input fields for upper and lower thresholds (defaulted at 0.9 and 0.1) help identify overbought and oversold conditions.
Visual Aids: Dashed horizontal lines at the threshold levels make it easy to visualize critical levels on the chart.
How to Use the IBS Indicator
When the IBS value exceeds the upper threshold (e.g., 0.9), it suggests the asset is closing near its high and may be overbought.
When the IBS value falls below the lower threshold (e.g., 0.1), it indicates the asset is closing near its low and may be oversold.
Use RSI to confirm overbought or oversold conditions identified by the IBS.
Incorporate moving averages to identify the overall trend and filter signals.
High trading volume can strengthen signals provided by the IBS.
If the price is making lower lows while the IBS is making higher lows, it may signal a potential upward reversal.
If the price is making higher highs and the IBS is making lower highs, a downward reversal might be imminent.
Conclusion
The Inner Bar Strength (IBS) indicator is a valuable tool for traders seeking to understand intraday momentum and potential reversal points. By measuring where the closing price lies within the day's range, it provides immediate insights into market sentiment. When used alongside other technical analysis tools, the IBS can enhance your trading strategy by identifying overbought or oversold conditions, confirming breakouts, and highlighting potential divergence signals.
Exposure Oscillator (Cumulative 0 to ยฑ100%)
Exposure Oscillator (Cumulative 0 to ยฑ100%)
This Pine Script indicator plots an "Exposure Oscillator" on the chart, which tracks the cumulative market exposure from a range of technical buy and sell signals. The exposure is measured on a scale from -100% (maximum short exposure) to +100% (maximum long exposure), helping traders assess the strength of their position in the market. It provides an intuitive visual cue to aid decision-making for trend-following strategies.
Buy Signals (Increase Exposure Score by +10%)
Buy Signal 1 (Cross Above 21 EMA):
This signal is triggered when the price crosses above the 21-period Exponential Moving Average (EMA), where the current bar closes above the EMA21, and the previous bar closed below the EMA21. This indicates a potential upward price movement as the market shifts into a bullish trend.
buySignal1 = ta.crossover(close, ema21)
Buy Signal 2 (Trending Above 21 EMA):
This signal is triggered when the price closes above the 21-period EMA for each of the last 5 bars, indicating a sustained bullish trend. It confirms that the price is consistently above the EMA21 for a significant period.
buySignal2 = ta.barssince(close <= ema21) > 5
Buy Signal 3 (Living Above 21 EMA):
This signal is triggered when the price has closed above the 21-period EMA for each of the last 15 bars, demonstrating a strong, prolonged uptrend.
buySignal3 = ta.barssince(close <= ema21) > 15
Buy Signal 4 (Cross Above 50 SMA):
This signal is triggered when the price crosses above the 50-period Simple Moving Average (SMA), where the current bar closes above the 50 SMA, and the previous bar closed below it. It indicates a shift toward bullish momentum.
buySignal4 = ta.crossover(close, sma50)
Buy Signal 5 (Cross Above 200 SMA):
This signal is triggered when the price crosses above the 200-period Simple Moving Average (SMA), where the current bar closes above the 200 SMA, and the previous bar closed below it. This suggests a long-term bullish trend.
buySignal5 = ta.crossover(close, sma200)
Buy Signal 6 (Low Above 50 SMA):
This signal is true when the lowest price of the current bar is above the 50-period SMA, indicating strong bullish pressure as the price maintains itself above the moving average.
buySignal6 = low > sma50
Buy Signal 7 (Accumulation Day):
An accumulation day occurs when the closing price is in the upper half of the daily range (greater than 50%) and the volume is larger than the previous bar's volume, suggesting buying pressure and accumulation.
buySignal7 = (close - low) / (high - low) > 0.5 and volume > volume
Buy Signal 8 (Higher High):
This signal occurs when the current barโs high exceeds the highest high of the previous 14 bars, indicating a breakout or strong upward momentum.
buySignal8 = high > ta.highest(high, 14)
Buy Signal 9 (Key Reversal Bar):
This signal is generated when the stock opens below the low of the previous bar but rallies to close above the previous barโs high, signaling a potential reversal from bearish to bullish.
buySignal9 = open < low and close > high
Buy Signal 10 (Distribution Day Fall Off):
This signal is triggered when a distribution day (a day with high volume and a close near the low of the range) "falls off" the rolling 25-bar period, indicating the end of a bearish trend or selling pressure.
buySignal10 = ta.barssince(close < sma50 and close < sma50) > 25
Sell Signals (Decrease Exposure Score by -10%)
Sell Signal 1 (Cross Below 21 EMA):
This signal is triggered when the price crosses below the 21-period Exponential Moving Average (EMA), where the current bar closes below the EMA21, and the previous bar closed above it. It suggests that the market may be shifting from a bullish trend to a bearish trend.
sellSignal1 = ta.crossunder(close, ema21)
Sell Signal 2 (Trending Below 21 EMA):
This signal is triggered when the price closes below the 21-period EMA for each of the last 5 bars, indicating a sustained bearish trend.
sellSignal2 = ta.barssince(close >= ema21) > 5
Sell Signal 3 (Living Below 21 EMA):
This signal is triggered when the price has closed below the 21-period EMA for each of the last 15 bars, suggesting a strong downtrend.
sellSignal3 = ta.barssince(close >= ema21) > 15
Sell Signal 4 (Cross Below 50 SMA):
This signal is triggered when the price crosses below the 50-period Simple Moving Average (SMA), where the current bar closes below the 50 SMA, and the previous bar closed above it. It indicates the start of a bearish trend.
sellSignal4 = ta.crossunder(close, sma50)
Sell Signal 5 (Cross Below 200 SMA):
This signal is triggered when the price crosses below the 200-period Simple Moving Average (SMA), where the current bar closes below the 200 SMA, and the previous bar closed above it. It indicates a long-term bearish trend.
sellSignal5 = ta.crossunder(close, sma200)
Sell Signal 6 (High Below 50 SMA):
This signal is true when the highest price of the current bar is below the 50-period SMA, indicating weak bullishness or a potential bearish reversal.
sellSignal6 = high < sma50
Sell Signal 7 (Distribution Day):
A distribution day is identified when the closing range of a bar is less than 50% and the volume is larger than the previous bar's volume, suggesting that selling pressure is increasing.
sellSignal7 = (close - low) / (high - low) < 0.5 and volume > volume
Sell Signal 8 (Lower Low):
This signal occurs when the current bar's low is less than the lowest low of the previous 14 bars, indicating a breakdown or strong downward momentum.
sellSignal8 = low < ta.lowest(low, 14)
Sell Signal 9 (Downside Reversal Bar):
A downside reversal bar occurs when the stock opens above the previous bar's high but falls to close below the previous barโs low, signaling a reversal from bullish to bearish.
sellSignal9 = open > high and close < low
Sell Signal 10 (Distribution Cluster):
This signal is triggered when a distribution day occurs three times in the rolling 7-bar period, indicating significant selling pressure.
sellSignal10 = ta.valuewhen((close < low) and volume > volume , 1, 7) >= 3
Theme Mode:
Users can select the theme mode (Auto, Dark, or Light) to match the chart's background or to manually choose a light or dark theme for the oscillator's appearance.
Exposure Score Calculation: The script calculates a cumulative exposure score based on a series of buy and sell signals.
Buy signals increase the exposure score, while sell signals decrease it. Each signal impacts the score by ยฑ10%.
Signal Conditions: The buy and sell signals are derived from multiple conditions, including crossovers with moving averages (EMA21, SMA50, SMA200), trend behavior, and price/volume analysis.
Oscillator Visualization: The exposure score is visualized as a line on the chart, changing color based on whether the exposure is positive (long position) or negative (short position). It is limited to the range of -100% to +100%.
Position Type: The indicator also indicates the position type based on the exposure score, labeling it as "Long," "Short," or "Neutral."
Horizontal Lines: Reference lines at 0%, 100%, and -100% visually mark neutral, increasing long, and increasing short exposure levels.
Exposure Table: A table displays the current exposure level (in percentage) and position type ("Long," "Short," or "Neutral"), updated dynamically based on the oscillatorโs value.
Inputs:
Theme Mode: Choose "Auto" to use the default chart theme, or manually select "Dark" or "Light."
Usage:
This oscillator is designed to help traders track market sentiment, gauge exposure levels, and manage risk. It can be used for long-term trend-following strategies or short-term trades based on moving average crossovers and volume analysis.
The oscillator operates in conjunction with the chartโs price action and provides a visual representation of the marketโs current trend strength and exposure.
Important Considerations:
Risk Management: While the exposure score provides valuable insight, it should be combined with other risk management tools and analysis for optimal trading decisions.
Signal Sensitivity: The accuracy and effectiveness of the signals depend on market conditions and may require adjustments based on the userโs trading strategy or timeframe.
Disclaimer:
This script is for educational purposes only. Trading involves significant risk, and users should carefully evaluate all market conditions and apply appropriate risk management strategies before using this tool in live trading environments.
Nasan Hull-smoothed envelope The Nasan Hull-Smoothed Envelope indicator is a sophisticated overlay designed to track price movement within an adaptive "envelope." It dynamically adjusts to market volatility and trend strength, using a series of smoothing and volatility-correction techniques. Here's a detailed breakdown of its components, from the input settings to the calculated visual elements:
Inputs
look_back_length (500):
Defines the lookback period for calculating intraday volatility (IDV), smoothing it over time. A higher value means the indicator considers a longer historical range for volatility calculations.
sl (50):
Sets the smoothing length for the Hull Moving Average (HMA). The HMA smooths various lines, creating a balance between sensitivity and stability in trend signals.
mp (1.5):
Multiplier for IDV, scaling the volatility impact on the envelope. A higher multiplier widens the envelope to accommodate higher volatility, while a lower one tightens it.
p (0.625):
Weight factor that determines the balance between extremes (highest high and lowest low) and averages (sma of high and sma of low) in the high/low calculations. A higher p gives more weight to extremes, making the envelope more responsive to abrupt market changes.
Volatility Calculation (IDV)
The Intraday Volatility (IDV) metric represents the average volatility per bar as an exponentially smoothed ratio of the high-low range to the close price. This is calculated over the look_back_length period, providing a base volatility value which is then scaled by mp. The IDV enables the envelope to dynamically widen or narrow with market volatility, making it sensitive to current market conditions.
Composite High and Low Bands
The high and low bands define the upper and lower bounds of the envelope.
High Calculation
a_high:
Uses a multi-period approach to capture the highest highs over several intervals (5, 8, 13, 21, and 34 bars). Averaging these highs provides a more stable reference for the high end of the envelope, capturing both immediate and recent peak values.
b_high:
Computes the average of shorter simple moving averages (5, 8, and 13 bars) of the high prices, smoothing out fluctuations in the recent highs. This generates a balanced view of high price trends.
high_c:
Combines a_high and b_high using the weight p. This blend creates a composite high that balances between recent peaks and smoothed averages, making the upper envelope boundary adaptive to short-term price shifts.
Low Calculation
a_low and b_low:
Similar to the high calculation, these capture extreme lows and smooth low values over the same intervals. This approach creates a stable and adaptive lower bound for the envelope.
low_c:
Combines a_low and b_low using the weight p, resulting in a composite low that adjusts to price fluctuations while maintaining a stable trend line.
Volatility-Adjusted Bands
The final composite high (c_high) and composite low (c_low) bands are adjusted using IDV, which accounts for intraday volatility. When volatility is high, the bands expand; when itโs low, they contract, providing a visual representation of volatility-adjusted price bounds.
Basis Line
The basis line is a Hull Moving Average (HMA) of the average of c_high and c_low. The HMA is known for its smoothness and responsiveness, making the basis line a central trend indicator. The color of the basis line changes:
Green when the basis line is increasing.
Red when the basis line is decreasing.
This color-coded basis line serves as a quick visual reference for trend direction.
Short-Term Trend Strength Block
This component analyzes recent price action to assess short-term bullish and bearish momentum.
Conditions (green, red, green1, red1):
These are binary conditions that categorize price movements as bullish or bearish based on the close compared to the open and the closeโs relationship with the exponential moving average (EMA). This separation helps capture different types of strength (above/below EMA) and different bullish or bearish patterns.
Composite Trend Strength Values:
Each of the bullish and bearish counts (above and below the EMA) is normalized, resulting in the following values:
green_EMAup_a and red_EMAup_a for bullish and bearish strength above the EMA.
green_EMAdown_a and red_EMAdown_a for bullish and bearish strength below the EMA.
Trend Strength (t_s):
This calculated metric combines the normalized trend strengths with extra weight to conditions above the EMA, giving more relevance to trends that have momentum behind them.
Enhanced Trend Strength
avg_movement:
Calculates the average absolute price movement over the short_term_length, providing a measurement of recent price activity that scales with volatility.
enhanced_t_s:
Multiplies t_s by avg_movement, creating an enhanced trend strength value that reflects both directional strength and the magnitude of recent price movement.
min and max:
Minimum and maximum percentile thresholds, respectively, based on enhanced_t_s for controlling the color gradient in the fill area.
Fill Area
The fill area between plot_c_high and plot_c_low is color-coded based on the enhanced trend strength (enhanced_t_s):
Gradient color transitions from blue to green based on the strength level, with blue representing weaker trends and green indicating stronger trends.
This visual fill provides an at-a-glance assessment of trend strength across the envelope, with color shifts highlighting momentum shifts.
Summary
The indicatorโs purpose is to offer an adaptive price envelope that reflects real-time market volatility and trend strength. Hereโs what each component contributes:
Basis Line: A trend-following line in the center that adjusts color based on trend direction.
Envelope (c_high, c_low): Adapts to volatility by expanding and contracting based on IDV, giving traders a responsive view of expected price bounds.
Fill Area: A color-gradient region representing trend strength within the envelope, helping traders easily identify momentum changes.
Overall, this tool helps to identify trend direction, market volatility, and strength of price movements, allowing for more informed decisions based on visual cues around price boundaries and trend momentum.
Price Action Smart Money Concepts [BigBeluga]THE SMART MONEY CONCEPTS Toolkit
The Smart Money Concepts [ BigBeluga ] is a comprehensive toolkit built around the principles of "smart money" behavior, which refers to the actions and strategies of institutional investors.
The Smart Money Concepts Toolkit brings together a suite of advanced indicators that are all interconnected and built around a unified concept: understanding and trading like institutional investors, or "smart money." These indicators are not just randomly chosen tools; they are features of a single overarching framework, which is why having them all in one place creates such a powerful system.
This all-in-one toolkit provides the user with a unique experience by automating most of the basic and advanced concepts on the chart, saving them time and improving their trading ideas.
Real-time market structure analysis simplifies complex trends by pinpointing key support, resistance, and breakout levels.
Advanced order block analysis leverages detailed volume data to pinpoint high-demand zones, revealing internal market sentiment and predicting potential reversals. This analysis utilizes bid/ask zones to provide supply/demand insights, empowering informed trading decisions.
Imbalance Concepts (FVG and Breakers) allows traders to identify potential market weaknesses and areas where price might be attracted to fill the gap, creating opportunities for entry and exit.
Swing failure patterns help traders identify potential entry points and rejection zones based on price swings.
Liquidity Concepts, our advanced liquidity algorithm, pinpoints high-impact events, allowing you to predict market shifts, strong price reactions, and potential stop-loss hunting zones. This gives traders an edge to make informed trading decisions based on liquidity dynamics.
๐ต FEATURES
The indicator has quite a lot of features that are provided below:
Swing market structure
Internal market structure
Mapping structure
Adjustable market structure
Strong/Weak H&L
Sweep
Volumetric Order block / Breakers
Fair Value Gaps / Breakers (multi-timeframe)
Swing Failure Patterns (multi-timeframe)
Deviation area
Equal H&L
Liquidity Prints
Buyside & Sellside
Sweep Area
Highs and Lows (multi-timeframe)
๐ต BASIC DEMONSTRATION OF ALL FEATURES
1. MARKET STRUCTURE
The preceding image illustrates the market structure functionality within the Smart Money Concepts indicator.
โค Solid lines: These represent the core indicator's internal structure, forming the foundation for most other components. They visually depict the overall market direction and identify major reversal points marked by significant price movements (denoted as 'x').
โค Internal Structure: These represent an alternative internal structure with the potential to drive more rapid market shifts. This is particularly relevant when a significant gap exists in the established swing structure, specifically between the Break of Structure (BOS) and the most recent Change of High/Low (CHoCH). Identifying these formations can offer opportunities for quicker entries and potential short-term reversals.
โค Sweeps (x): These signify potential turning points in the market where liquidity is removed from the structure. This suggests a possible trend reversal and presents crucial entry opportunities. Sweeps are identified within both swing and internal structures, providing valuable insights for informed trading decisions.
โค Mapping structure: A tool that automatically identifies and connects significant price highs and lows, creating a zig-zag pattern. It visualizes market structure, highlights trends, support/resistance levels, and potential breakouts. Helps traders quickly grasp price action patterns and make informed decisions.
โค Color-coded candles based on market structure: These colors visually represent the underlying market structure, making it easier for traders to quickly identify trends.
โค Extreme H&L: It visualizes market structure with extreme high and lows, which gives perspective for macro Market Structure.
2. VOLUMETRIC ORDER BLOCKS
Order blocks are specific areas on a financial chart where significant buying or selling activity has occurred. These are not just simple zones; they contain valuable information about market dynamics. Within each of these order blocks, volume bars represent the actual buying and selling activity that took place. These volume bars offer deeper insights into the strength of the order block by showing how much buying or selling power is concentrated in that specific zone.
Additionally, these order blocks can be transformed into Breaker Blocks. When an order block failsโmeaning the price breaks through this zone without reversingโit becomes a breaker block. Breaker blocks are particularly useful for trading breakouts, as they signal that the market has shifted beyond a previously established zone, offering opportunities for traders to enter in the direction of the breakout.
Here's a breakdown:
โค Bear Order Blocks (Red): These are zones where a lot of selling happened. Traders see these areas as places where sellers were strong, pushing the price down. When the price returns to these zones, it might face resistance and drop again.
โค Bull Order Blocks (Green): These are zones where a lot of buying happened. Traders see these areas as places where buyers were strong, pushing the price up. When the price returns to these zones, it might find support and rise again.
These Order Blocks help traders identify potential areas for entering or exiting trades based on past market activity. The volume bars inside blocks show the amount of trading activity that occurred in these blocks, giving an idea of the strength of buying or selling pressure.
โค Breaker Block: When an order block fails, meaning the price breaks through this zone without reversing, it becomes a breaker block. This indicates a significant shift in market liquidity and structure.
โค A bearish breaker block occurs after a bullish order block fails. This typically happens when there's an upward trend, and a certain level that was expected to support the market's rise instead gives way, leading to a sharp decline. This decline indicates that sellers have overcome the buyers, absorbing liquidity and shifting the sentiment from bullish to bearish.
Conversely, a bullish breaker block is formed from the failure of a bearish order block. In a downtrend, when a level that was expected to act as resistance is breached, and the price shoots up, it signifies that buyers have taken control, overpowering the sellers.
3. FAIR VALUE GAPS:
A fair value gap (FVG), also referred to as an imbalance, is an essential concept in Smart Money trading. It highlights the supply and demand dynamics. This gap arises when there's a notable difference between the volume of buy and sell orders. FVGs can be found across various asset classes, including forex, commodities, stocks, and cryptocurrencies.
FVGs in this toolkit have the ability to detect raids of FVG which helps to identify potential price reversals.
Mitigation option helps to change from what source FVGs will be identified: Close, Wicks or AVG.
4. SWING FAILURE PATTERN (SFP):
The Swing Failure Pattern is a liquidity engineering pattern, generally used to fill large orders. This means, the SFP generally occurs when larger players push the price into liquidity pockets with the sole objective of filling their own positions.
SFP is a technical analysis tool designed to identify potential market reversals. It works by detecting instances where the price briefly breaks a previous high or low but fails to maintain that breakout, quickly reversing direction.
How it works:
Pattern Detection: The indicator scans for price movements that breach recent highs or lows.
Reversal Confirmation: If the price quickly reverses after breaching these levels, it's identified as an SFP.
โค SFP Display:
Bullish SFP: Marked with a green symbol when price drops below a recent low before reversing upwards.
Bearish SFP: Marked with a red symbol when price rises above a recent high before reversing downwards.
โค Deviation Levels: After detecting an SFP, the indicator projects white lines showing potential price deviation:
For bullish SFPs, the deviation line appears above the current price.
For bearish SFPs, the deviation line appears below the current price.
These deviation levels can serve as a potential trading opportunity or areas where the reversal might lose momentum.
With Volume Threshold and Filtering of SFP traders can adjust their trading style:
Volume Threshold: This setting allows traders to filter SFPs based on the volume of the reversal candle. By setting a higher volume threshold, traders can focus on potentially more significant reversals that are backed by higher trading activity.
SFP Filtering: This feature enables traders to filter SFP detection. It includes parameters such as:
5. LIQUIDITY CONCEPTS:
โค Equal Lows (EQL) and Equal Highs (EQH) are important concepts in liquidity-based trading.
EQL: A series of two or more swing lows that occur at approximately the same price level.
EQH: A series of two or more swing highs that occur at approximately the same price level.
EQLs and EQHs are seen as potential liquidity pools where a large number of stop loss orders or limit orders may be clustered. They can be used as potential reverse points for trades.
This multi-period feature allows traders to select less and more significant EQL and EQH:
โค Liquidity wicks:
Liquidity wicks are a minor representation of a stop-loss hunt during the retracement of a pivot point:
โค Buy and Sell side liquidity:
The buy side liquidity represents a concentration of potential buy orders below the current price level. When price moves into this area, it can lead to increased buying pressure due to the execution of these orders.
The sell side liquidity indicates a pool of potential sell orders below the current price level. Price movement into this area can result in increased selling pressure as these orders are executed.
โค Sweep Liquidation Zones:
Sweep Liquidation Zones are crucial for understanding market structure and potential future price movements. They provide insights into areas where significant market participants have been forced out of their positions, potentially setting up new trading opportunities.
๐ต USAGE & EXAMPLES
The core principle behind the success of this toolkit lies in identifying "confluence." This refers to the convergence of multiple trading indicators all signaling the same information at a specific point or area. By seeking such alignment, traders can significantly enhance the likelihood of successful trades.
MS + OBs
The chart illustrates a highly bullish setup where the price is rejecting from a bullish order block (POC), while simultaneously forming a bullish Swing Failure Pattern (SFP). This occurs after an internal structure change, marked by a bullish Change of Character (CHoCH). The price broke through a bearish order block, transforming it into a breaker block, further confirming the bullish momentum.
The combination of these elementsโbullish order blocks, SFP, and CHoCHโcreates a powerful bullish signal, reinforcing the potential for upward movement in the market.
SFP + Bear OB
This chart above displays a bearish setup with a high probability of a price move lower. The price is currently rejecting from a bear order block, which represents a key resistance area where significant selling pressure has previously occurred. A Swing Failure Pattern (SFP) has also formed near this bear order block, indicating that the price briefly attempted to break above a recent high but failed to sustain that upward movement. This failure suggests that buyers are losing momentum, and the market could be preparing for a move to the downside.
Additionally, we can toggle on the Deviation Area in the SFP section to highlight potential levels where price deviation might occur. These deviation areas represent zones where the price is likely to react after the Swing Failure Pattern:
BUY โ SELL sides + EQL
The chart showcases a bullish setup with a high probability of price breaking out of the current sell-side resistance level. The market structure indicates a formation of Equal Lows (EQL), which often suggests a build-up of liquidity that could drive the price higher.
The presence of strong buy-side pressure (69%), indicated by the green zone at the bottom, reinforces this bullish outlook. This area represents a key support zone where buyers are outpacing sellers, providing the foundation for a potential upward breakout.
EQL + Bull ChoCh
This chart illustrates a potential bullish setup, driven by the formation of Equal Lows (EQL) followed by a bullish Change of Character (CHoCH). The presence of Equal Lows often signals a liquidity build-up, which can lead to a reversal when combined with additional bullish signals.
Liquidity grab + Bull ChoCh + FVGs
This chart demonstrates a strong bullish scenario, where several important market dynamics are at play. The price begins its upward momentum from Liquidity grab following a bullish Change of Character (CHoCH), signaling the transition from a bearish phase to a bullish one.
As the price progresses, it performs liquidity grabs, which serve to gather the necessary fuel for further movement. These liquidity grabs often occur before significant price surges, as large market participants exploit these areas to accumulate positions before pushing the price higher.
The chart also highlights a market imbalance area, showing strong momentum as the price moves swiftly through this zone.
In this examples, we see how the combination of multiple โsmart moneyโ tools helps identify a potential trade opportunities. This is just one of the many scenarios that traders can spot using this toolkit. Other combinationsโsuch as order blocks, liquidity grabs, fair value gaps, and Swing Failure Patterns (SFPs)โcan also be layered on top of these concepts to further refine your trading strategy.
๐ต SETTINGS
Window: limit calculation period
Swing: limit drawing function
Mapping structure: show structural points
Algorithmic Logic: (Extreme-Adjusted) Use max high/low or pivot point calculation
Algorithmic loopback: pivot point look back
Show Last: Amount of Order block to display
Hide Overlap: hide overlapping order blocks
Construction: Size of the order blocks
Fair value gaps: Choose between normal FVG or Breaker FVG
Mitigation: (close - wick - avg) point to mitigate the order block/imbalance
SFP lookback: find a higher / lower point to improve accuracy
Threshold: remove less relevant SFP
Equal H&L: (short-mid-long term) display longer term
Liquidity Prints: Shows wicks of candles where liquidity was grabbed
Sweep Area: Identify Sweep Liquidation areas
By combining these indicators in one toolkit, traders are equipped with a comprehensive suite of tools that address every angle of the Smart Money Concept. Instead of relying on disparate tools spread across various platforms, having them integrated into a single, cohesive system allows traders to easily see confluence and make more informed trading decisions.
Previous Highs & Lows [LuxAlgo]The Previous Highs & Lows indicator highlights a user-set amount of previous maximum/minimum prices made within specific intervals, these are displayed as levels customizable levels.
Additionally, one upper and lower zone constructed from the previously displayed highs/lows is included, providing support/resistance areas.
๐ถ USAGE
Previous highs/lows are often perceived as key trading levels with the potential of generating multiple reactions upon being reached.
While the daily interval is more commonly used, users can use different intervals, with the indicator supporting hourly, daily, weekly, monthly, and yearly intervals. Using higher intervals on low timeframes can return more distant levels relative to the most recent price, which might not be relevant.
Each level is numbered, with more recent previous highs/lows having a lower number associated with them, users can also highlight more recent levels through a transparency gradient.
Users can control the amount of previous highs/lows displayed using the "Show Last" settings, with a higher value providing more potential support/resistance. Returned previous highs/lows can eventually be filtered out based on their position by enabling the "Filter Based On Position" setting, only keeping previous highs above the current closing price and previous lows below the current closing price, giving more relevant levels as a result.
๐น Previous High/Low Areas
The indicator includes two areas constructed from the respective percentiles of the returned previous highs/lows. These can be useful as more general support/resistance areas.
Wider areas are often indicative of a group of previous highs or lows being more dispersed, resulting in areas that are easier to reach. Wider areas can also be obtained by increasing the "Areas Width" setting.
Note: Areas will only be displayed if "Show Last" is greater than 1
๐ถ SETTINGS
Show Last: Determines the amount of more recent previous highs and previous low levels displayed by the indicator.
Interval: Interval used to capture maximum/minimum price values,
Areas Width: Width of the displayed top/bottom areas, with higher values returning wider areas.
Filter Based On Position: When enabled only display previous highs above the current closing price and previous lows below the current closing price.
๐น Style
Minimum Gradient Transparency: Minimum transparency value applied to the colors of the oldest displayed previous highs/lows levels.
ZigZag Library [TradingFinder]๐ต Introduction
The "Zig Zag" indicator is an analytical tool that emerges from pricing changes. Essentially, it connects consecutive high and low points in an oscillatory manner. This method helps decipher price changes and can also be useful in identifying traditional patterns.
By sifting through partial price changes, "Zig Zag" can effectively pinpoint price fluctuations within defined time intervals.
๐ต Key Features
1. Drawing the Zig Zag based on Pivot points :
The algorithm is based on pivots that operate consecutively and alternately (switch between high and low swing). In this way, zigzag lines are connected from a swing high to a swing low and from a swing low to a swing high.
Also, with a very low probability, it is possible to have both low pivots and high pivots in one candle. In these cases, the algorithm tries to make the best decision to make the most suitable choice.
You can control what period these decisions are based on through the "PiPe" parameter.
2.Naming and labeling each pivot based on its position as "Higher High" (HH), "Lower Low" (LL), "Higher Low" (HL), and "Lower High" (LH).
Additionally, classic patterns such as HH, LH, LL, and HL can be recognized. All traders analyzing financial markets using classic patterns and Elliot Waves can benefit from the "zigzag" indicator to facilitate their analysis.
" HH ": When the price is higher than the previous peak (Higher High).
" HL ": When the price is higher than the previous low (Higher Low).
" LH ": When the price is lower than the previous peak (Lower High).
" LL ": When the price is lower than the previous low (Lower Low).
๐ต How to Use
First, you can add the library to your code as shown in the example below.
import TFlab/ZigZagLibrary_TradingFinder/1 as ZZ
Function "ZigZag" Parameters :
๐ฃ Logical Parameters
1. HIGH : You should place the "high" value here. High is a float variable.
2. LOW : You should place the "low" value here. Low is a float variable.
3. BAR_INDEX : You should place the "bar_index" value here. Bar_index is an integer variable.
4. PiPe : The desired pivot period for plotting Zig Zag is placed in this parameter. For example, if you intend to draw a Zig Zag with a Swing Period of 5, you should input 5.
PiPe is an integer variable.
Important :
Apart from the "PiPe" indicator, which is part of the customization capabilities of this indicator, you can create a multi-time frame mode for the indicator using 3 parameters "High", "Low" and "BAR_INDEX". In this way, instead of the data of the current time frame, use the data of other time frames.
Note that it is better to use the current time frame data, because using the multi-time frame mode is associated with challenges that may cause bugs in your code.
๐ฃ Setting Parameters
5. SHOW_LINE : It's a boolean variable. When true, the Zig Zag line is displayed, and when false, the Zig Zag line display is disabled.
6. STYLE_LINE : In this variable, you can determine the style of the Zig Zag line. You can input one of the 3 options: line.style_solid, line.style_dotted, line.style_dashed. STYLE_LINE is a constant string variable.
7. COLOR_LINE : This variable takes the input of the line color.
8. WIDTH_LINE : The input for this variable is a number from 1 to 3, which is used to adjust the thickness of the line that draws the Zig Zag. WIDTH_LINE is an integer variable.
9. SHOW_LABEL : It's a boolean variable. When true, labels are displayed, and when false, label display is disabled.
10. COLOR_LABEL : The color of the labels is set in this variable.
11. SIZE_LABEL : The size of the labels is set in this variable. You should input one of the following options: size.auto, size.tiny, size.small, size.normal, size.large, size.huge.
12. Show_Support : It's a boolean variable that, when true, plots the last support line, and when false, disables its plotting.
13. Show_Resistance : It's a boolean variable that, when true, plots the last resistance line, and when false, disables its plotting.
Suggestion :
You can use the following code snippet to import Zig Zag into your code for time efficiency.
//import Library
import TFlab/ZigZagLibrary_TradingFinder/1 as ZZ
// Input and Setting
// Zig Zag Line
ShZ = input.bool(true , 'Show Zig Zag Line', group = 'Zig Zag') //Show Zig Zag
PPZ = input.int(5 ,'Pivot Period Zig Zag Line' , group = 'Zig Zag') //Pivot Period Zig Zag
ZLS = input.string(line.style_dashed , 'Zig Zag Line Style' , options = , group = 'Zig Zag' )
//Zig Zag Line Style
ZLC = input.color(color.rgb(0, 0, 0) , 'Zig Zag Line Color' , group = 'Zig Zag') //Zig Zag Line Color
ZLW = input.int(1 , 'Zig Zag Line Width' , group = 'Zig Zag')//Zig Zag Line Width
// Label
ShL = input.bool(true , 'Label', group = 'Label') //Show Label
LC = input.color(color.rgb(0, 0, 0) , 'Label Color' , group = 'Label')//Label Color
LS = input.string(size.tiny , 'Label size' , options = , group = 'Label' )//Label size
Show_Support= input.bool(false, 'Show Last Support',
tooltip = 'Last Support' , group = 'Support and Resistance')
Show_Resistance = input.bool(false, 'Show Last Resistance',
tooltip = 'Last Resistance' , group = 'Support and Resistance')
//Call Function
ZZ.ZigZag(high ,low ,bar_index ,PPZ , ShZ ,ZLS , ZLC, ZLW ,ShL , LC , LS , Show_Support , Show_Resistance )
Price-Action CandlesWhat is a swing high or swing low?
Swing highs and lows are price extremes. For example say we set our swing length to 5. A candle that is a swing high with a swing length of 5 will have 5 bars to the left that are lower and 5 bars to the right that are lower. A candle that is a swing low with a swing length of 5 will have 5 bars to the left that are higher and 5 bars to the right that are higher.
How are the trend candles calculated?
The trend candles are calculated by storing and comparing historical swing lows and swing highs.
The pinescript code goes as follows:
The pinescript code goes as follows:
var int trend = na
trend := ((hh and high >= psh) or close > csh) ? 1 : ((ll and low <= psl) or close < csl) ? -1 : lh or hl ? 0 : trend
What does that gibberish mean?
-Candle can be GREEN IF
- We have a higher high (current swing high is greater than the previous swing high) and the high is greater than the previous swing high
- OR The current close is greater than the current swing high
-Candle can be RED IF
- We have a lower low (current swing low is less than the previous swing low) and the low is less than the previous swing low
- OR The current close is less than the current swing low
-Candle can be YELLOW IF
- We have a new swing high and the new swing high is less than the previous swing high
- OR We have a new swing low and the new swing low is greater than the previous swing low
If none of the conditions above are true then we continue with whatever color the previous bar was.
What is repainting?
Repainting is "script behavior causing historical vs realtime calculations or plots to behave differently." That definition comes directly from Tradingview. If you want to read the full explanation you can visit it here www.tradingview.com . The price-action candles use swing highs and swing lows which need bars to the left (past) and bars to the right ("future") in order to confirm the swing level. Because of the need to wait for confirmation to for swing levels the plot style can be repainting. With the price-action candles indicator the only repainting part of the indicator is the labels. The price-action candles themselves WILL NOT REPAINT. The labels however can be set to repaint or not depending on the user preference. If the user opts to use repainting then the label location is shifted back by the length of the price-action. So if the "Price-Action Length" input is set to 10, and the user wants repainting, the swing high/low label will be shifted back 10 bars. If the user opts for no repainting, the label will not be shifted and instead show on the exact bar the swing level was confirmed.
Examples Below.
Repaint
Here the labels are shifted back the price-action length.
Non-Repaint
Here the labels are not shifted back because the input setting is set to not repaint.
Multi-timeframe Analysis
The users can view the trend from multiple different timeframes at once with a table displayed at the bottom of their charts. The timeframe can be lower or higher than the chart timeframe.
More examples
Be on the lookout for the Price Action Candles (Lower) indicator where you can view the multi-timeframe labels on a lower price grid in order to see the history over time!
Scoopy StacksWaffle Around Multiple
(Open, High, Low, Close) Stacks On
Pre/Post Market & (Daily, Weekly,
Monthly, Yearly) Sessions With
Meticulous Columns, Rows, Tooltips,
Colors, Custom Ideas, and Alerts.
Sessions Use Two Step Incremental Values
Default Value: (1) Shows Two Previous
(O, H, L, C); Increasing Value Swaps
Sessions With Next Two Stacks.
โฌ๏ธ KEY WORDS:
๐ข Crossover | ๐ด Crossunder
๐ High | ๐ Low
๐ Open | ๐ Close
๐ฅ First Idea | ๐ฅ Second Idea
๐ฅ Third Idea | ๐๏ธ Fourth Idea
๐ฅ ALERTS:
Default Option: (Per Bar)
Alerts Once Conditions Are Met
(Bar Close) Alerts When Bar Closes
Default Option: (Reg)
Alerts During Regular Market
Trading Hours, (0930-1600)
(Ext) Alerts During Extended
Market Hours, (1600-0930)
(24/7) Alerts All Day
Optional Preferences:
Regular Alerts - Stocks
Extended Alerts - Futures
24/7 Alerts - Crypto
๐ง STACKS:
Default Value: (1)
Incremental Stack Value, Increasing Value
Swaps Sessions With the Next Two Stacks
(โ) Swap Stacks?
Pre/Post Market High/Lows,
1-2 Day High/Lows, 1-2 Week High/Lows,
1-2 Month High/Lows, 1-2 Year High/Lows
( ) Swap Stacks?
Pre/Post Market Open/Close,
1-2 Day Open/Close, 1-2 Week Open/Close,
1-2 Month Open/Close, 1-2 Year Open/Close
๐จ EXAMPLES:
Default Stack:
๐ข | ๐ Pre Market High (PRE) | 4600.00
๐ด | ๐ Post Market Low (POST) | 420.00
Optional: (Open)
๐ข | ๐ Post Market Open (POST) | 4400.00
Optional: (Close)
๐ด | ๐ Pre Market Close (PRE) | 430.00
Default Stack Value: (1)
๐ด | ๐ 1 Day High (1DH) | 460.00
Next Stack Value: (3)
๐ข | ๐ 4 Day Low (4DL) | 420.00
Optional: (Open)
๐ด | ๐ 2 Day Open (2DO) | 440.00
Optional: (Close)
๐ข | ๐ 3 Day Close (3DC) | 430.00
Default Stack Value: (5)
๐ข | ๐ 5 Week High (5WH) | 460.00
Next Stack Value: (7)
๐ด | ๐ 8 Week Low (8WL) | 420.00
Optional: (Open)
๐ด | ๐ 7 Week Open (7WO) | 4400.00
Optional: (Close)
๐ข | ๐ 6 Week Close (6WC) | 430.00
Default Stack Value: (9)
๐ด | ๐ 9 Month High (9MH) | 460.00
Next Stack Value: (11)
๐ข | ๐ 12 Month Low (12ML) | 420.00
Optional: (Open)
๐ข | ๐ 11 Month Open (11MO) | 4400.00
Optional: (Close)
๐ด | ๐ 10 Month Close (10MC) | 430.00
Default Stack Value: (13)
๐ข | ๐ 13 Year High (13YH) | 460.00
Next Stack Value: (15)
๐ข | ๐ 16 Year Low (16YL) | 420.00
Optional: (Open)
๐ด | ๐ 15 Year Open (15YO) | 4400.00
Optional: (Close)
๐ด | ๐ 14 Year Close (14YC) | 430.00
๐ฉ TABLES:
Default Value: (1)
Moves Table Up, Down, Left, or Right
Based on Second Default Value
First Default Value: (Top Right)
Sets Table Placement, Middle Center
Allows Table To Move In All Directions
Second Default Value: (Default)
Fixed Table Position, Switching Values
Moves Direction of the Table
๐ฆ IDEAS:
(โ) Show Ideas?
Shows Four Ideas With Custom Texts
and Values; Ideas Are Based Around
Post-It Note Reminders with Alerts
Suggestions For Text Ideas:
Take Profit, Stop Loss, Trim, Hold,
Long, Short, Bounce Spot, Retest,
Chop, Support, Resistance, Buy, Sell
๐ช EXAMPLES:
Default Value: (5)
Shows the Custom Table Value For
Sorted Table Positions and Alerts
Default Text: (๐ฅ)
Shown On First Table Cell and
Message Appearing On Alerts
Alert Shows: ๐ข | ๐ฅ | 5.00
Default Value: (10)
Shows the Custom Table Value For
Sorted Table Positions and Alerts
Default Text: (๐ฅ)
Shown On Second Table Cell and
Message Appearing On Alerts
Alert Shows: ๐ด | ๐ฅ | 10.00
Default Value: (50)
Shows the Custom Table Value For
Sorted Table Positions and Alerts
Default Text: (๐ฅ)
Shown On Third Table Cell and
Message Appearing On Alerts
Alert Shows: ๐ข | ๐ฅ | 50.00
Default Value: (100)
Shows the Custom Table Value For
Sorted Table Positions and Alerts
Default Text: (๐๏ธ)
Shown On Fourth Table Cell and
Message Appearing On Alerts
Alert Shows: ๐ด | ๐๏ธ | 100.00
โฌ๏ธ REFERENCES:
Pre-market Highs & Lows on regular
trading hours (RTH) chart
By Twingall
Previous Day Week Highs & Lows
By Sbtnc
Screener for 40+ instruments
By QuantNomad
Daily Weekly Monthly Yearly Opens
By Meliksah55
Ribbit RangesBounce Around Multiple
(Open, High, Low, Close) Ranges
On Pre/Post Market & (Daily, Weekly,
Monthly, Yearly) Sessions With
Meticulous Lines, Labels, Tooltips,
Colors, Custom Ideas, and Alerts.
Sessions Use Two Step Incremental Values
Default Value: (1) Shows Two Previous
(O, H, L, C); Increasing Value Swaps
Sessions With Next Two Ranges.
โฌ๏ธ KEY WORDS:
๐ข Crossover | ๐ด Crossunder
๐ High | ๐ Low
๐ Open | ๐ Close
๐ฅ First Idea | ๐ฅ Second Idea
๐ฅ Third Idea | ๐๏ธ Fourth Idea
๐ฅ ALERTS:
Default Option: (Per Bar)
Alerts Once Conditions Are Met
(Bar Close) Alerts When Bar Closes
Default Option: (Reg)
Alerts During Regular Market
Trading Hours, (0930-1600)
(Ext) Alerts During Extended
Market Hours, (1600-0930)
(24/7) Alerts All Day
Optional Preferences:
Regular Alerts - Stocks
Extended Alerts - Futures
24/7 Alerts - Crypto
๐ง RANGES:
Default Value: (1)
Incremental Range Value, Increasing Value
Swaps Sessions With the Next Two Ranges
(โ) Swap Ranges?
Pre/Post Market High/Lows,
1-2 Day High/Lows, 1-2 Week High/Lows,
1-2 Month High/Lows, 1-2 Year High/Lows
( ) Swap Ranges?
Pre/Post Market Open/Close,
1-2 Day Open/Close, 1-2 Week Open/Close,
1-2 Month Open/Close, 1-2 Year Open/Close
๐จ EXAMPLES:
Default Range:
๐ข | ๐ Pre Market High (PRE) | 4600.00
๐ด | ๐ Post Market Low (POST) | 420.00
Optional: (Open)
๐ข | ๐ Post Market Open (POST) | 4400.00
Optional: (Close)
๐ด | ๐ Pre Market Close (PRE) | 430.00
Default Range Value: (1)
๐ด | ๐ 1 Day High (1DH) | 460.00
Next Range Value: (3)
๐ข | ๐ 4 Day Low (4DL) | 420.00
Optional: (Open)
๐ด | ๐ 2 Day Open (2DO) | 440.00
Optional: (Close)
๐ข | ๐ 3 Day Close (3DC) | 430.00
Default Range Value: (5)
๐ข | ๐ 5 Week High (5WH) | 460.00
Next Range Value: (7)
๐ด | ๐ 8 Week Low (8WL) | 420.00
Optional: (Open)
๐ด | ๐ 7 Week Open (7WO) | 4400.00
Optional: (Close)
๐ข | ๐ 6 Week Close (6WC) | 430.00
Default Range Value: (9)
๐ด | ๐ 9 Month High (9MH) | 460.00
Next Range Value: (11)
๐ข | ๐ 12 Month Low (12ML) | 420.00
Optional: (Open)
๐ข | ๐ 11 Month Open (11MO) | 4400.00
Optional: (Close)
๐ด | ๐ 10 Month Close (10MC) | 430.00
Default Range Value: (13)
๐ข | ๐ 13 Year High (13YH) | 460.00
Next Range Value: (15)
๐ข | ๐ 16 Year Low (16YL) | 420.00
Optional: (Open)
๐ด | ๐ 15 Year Open (15YO) | 4400.00
Optional: (Close)
๐ด | ๐ 14 Year Close (14YC) | 430.00
๐ฉ COLORS:
(โ) Swap Colors?
Text Color Is Shown Using
Background Color
( ) Swap Colors?
Background Color Is Shown
Using Text Color
๐ฆ IDEAS:
(โ) Show Ideas?
Plots Four Ideas With Custom Lines
and Labels; Ideas Are Based Around
Post-It Note Reminders with Alerts
Suggestions For Text Ideas:
Take Profit, Stop Loss, Trim, Hold,
Long, Short, Bounce Spot, Retest,
Chop, Support, Resistance, Buy, Sell
๐ช EXAMPLES:
Default Value: (5)
Shows the Custom Value For
Lines, Labels, and Alerts
Default Text: (๐ฅ)
Shown On First Label and
Message Appearing On Alerts
Alert Shows: ๐ข | ๐ฅ | 5.00
Default Value: (10)
Shows the Custom Value For
Lines, Labels, and Alerts
Default Text: (๐ฅ)
Shown On Second Label and
Message Appearing On Alerts
Alert Shows: ๐ด | ๐ฅ | 10.00
Default Value: (50)
Shows the Custom Value For
Lines, Labels, and Alerts
Default Text: (๐ฅ)
Shown On Third Label and
Message Appearing On Alerts
Alert Shows: ๐ข | ๐ฅ | 50.00
Default Value: (100)
Shows the Custom Value For
Lines, Labels, and Alerts
Default Text: (๐๏ธ)
Shown On Fourth Label and
Message Appearing On Alerts
Alert Shows: ๐ด | ๐๏ธ | 100.00
โฌ๏ธ REFERENCES:
Pre-market Highs & Lows on regular
trading hours (RTH) chart
By Twingall
Previous Day Week Highs & Lows
By Sbtnc
Screener for 40+ instruments
By QuantNomad
Daily Weekly Monthly Yearly Opens
By Meliksah55
Z-Score Based Momentum Zones with Advanced Volatility ChannelsThe indicator "Z-Score Based Momentum Zones with Advanced Volatility Channels" combines various technical analysis components, including volatility, price changes, and volume correction, to calculate Z-Scores and determine momentum zones and provide a visual representation of price movements and volatility based on multi timeframe highest high and lowest low values.
Note: THIS IS A IMPROVEMNT OF "Multi Time Frame Composite Bands" INDICATOR OF MINE WITH MORE EMPHASIS ON MOMENTUM ZONES CALULATED BASED ON Z-SCORES
Input Options
look_back_length: This input specifies the look-back period for calculating intraday volatility. correction It is set to a default value of 5.
lookback_period: This input sets the look-back period for calculating relative price change. The default value is 5.
zscore_period: This input determines the look-back period for calculating the Z-Score. The default value is 500.
avgZscore_length: This input defines the length of the momentum block used in calculations, with a default value of 14.
include_vc: This is a boolean input that, if set to true, enables volume correction in the calculations. By default, it is set to false.
1. Volatility Bands (Composite High and Low):
Composite High and Low: These are calculated by combining different moving averages of the high prices (high) and low prices (low). Specifically:
a_high and a_low are calculated as the average of the highest (ta.highest) and lowest (ta.lowest) high and low prices over various look-back periods (5, 8, 13, 21, 34) to capture short and long-term trends.
b_high and b_low are calculated as the simple moving average (SMA) of the high and low prices over different look-back periods (5, 8, 13) to smooth out the trends.
high_c and low_c are obtained by averaging a_high with b_high and a_low with b_low respectively.
IDV Correction Calulation : In this script the Intraday Volatility (IDV) is calculated as the simple moving average (SMA) of the daily high-low price range divided by the closing price. This measures how much the price fluctuates in a given period.
Composite High and Low with Volatility: The final c_high and c_low values are obtained by adjusting high_c and low_c with the calculated intraday volatility (IDV). These values are used to create the "Composite High" and "Composite Low" plots.
Composite High and Low with Volatility Correction: The final c_high and c_low values are obtained by adjusting high_c and low_c with the calculated intraday volatility (IDV). These values are used to create the "Composite High" and "Composite Low" plots.
2. Momentum Blocks Based on Z-Score:
Relative Price Change (RPC):
The Relative Price Change (rpdev) is calculated as the difference between the current high-low-close average (hlc3) and the previous simple moving average (psma_hlc3) of the same quantity. This measures the change in price over time.
Additionally, std_hlc3 is calculated as the standard deviation of the hlc3 values over a specified look-back period. The standard deviation quantifies the dispersion or volatility in the price data.
The rpdev is then divided by the std_hlc3 to normalize the price change by the volatility. This normalization ensures that the price change is expressed in terms of standard deviations, which is a common practice in quantitative analysis.
Essentially, the rpdev represents how many standard deviations the current price is away from the previous moving average.
Volume Correction (VC): If the include_vc input is set to true, volume correction is applied by dividing the trading volume by the previous simple moving average of the volume (psma_volume). This accounts for changes in trading activity.
Volume Corrected Relative Price Change (VCRPD): The vcrpd is calculated by multiplying the rpdev by the volume correction factor (vc). This incorporates both price changes and volume data.
Z-Scores: The Z-scores are calculated by taking the difference between the vcrpd and the mean (mean_vcrpd) and then dividing it by the standard deviation (stddev_vcrpd). Z-scores measure how many standard deviations a value is away from the mean. They help identify whether a value is unusually high or low compared to its historical distribution.
Momentum Blocks: The "Momentum Blocks" are essentially derived from the Z-scores (avgZScore). The script assigns different colors to the "Fill Area" based on predefined Z-score ranges. These colored areas represent different momentum zones:
Positive Z-scores indicate bullish momentum, and different shades of green are used to fill the area.
Negative Z-scores indicate bearish momentum, and different shades of red are used.
Z-scores near zero (between -0.25 and 0.25) suggest neutrality, and a yellow color is used.
Moving Average - TREND POWER v1.1- (AS)0)NOTE:
This is first version of this indicator. It's way more complicated than it should be. Check out Moving Average-TREND POWER v2.1-(AS), its waaaaay less complicated and might be better.Enjoy...
1)INTRODUCTION/MAIN IDEA:
In simpliest form this script is a trend indicator that rises if Moving average if below price or falling if above and going back to zero if there is a crossover with a price. To use this indicator you will have to adjust settings of MAs and choose conditions for calculation.
While using the indicator we might have to define CROSS types or which MAs to use. List of what cross types are defined in the script and Conditiones to choose from.The list will be below.
2) COMPOSITION:
-MA1 can be defined by user in settings, possible types: SMA, EMA, RMA, HMA, TEMA, DEMA, LSMA, WMA.
-MA2 is always ALMA
3) OVERLAY:
Default is false but if you want to see MA1/2 on chart you can change code to true and then turn on overlay in settings. Most plot settings are avalible only in OV=false.
if OV=true possible plots ->MA1/2, plotshape when choosen cross type
if OV=false -> main indicator,TSHs,Cross counter
4)PRESETS :
Indicator has three modes that can be selected in settings. First two are presets and do not require selecting conditions as they set be default.
-SIMPLE - most basic
-ABSOLUTE - shows only positive values when market is trending or zero when in range
-CUSTOM - main and the most advanced form that will require setting conditions to use in calculating trend
4.1)SIMPLE โ this is the most basic form of conditions that uses only First MA. If MA1 is below selected source (High/Low(High for Uptrend and Low for DNtrend or OHLC4) on every bar value rises by 0.02. if it above Low or OHLC4 it falls by 0.02 with every bar. If there is a cross of MA with price value is zero. This preset uses CROSS_1_ULT(list of all cross types below)
4.2) ABSOLUTE โ does not show direction of the trend unlike others and uses both MA1 and MA2. Uses CROSS type 123_ULT
4.3) CUSTOM โ here we define conditions manually. This mode is defined in parts (5-8 of description)
5)SETTINGS:
SOURCE/OVERLAY(line1) โ select source of calculation form MA1/MA2, select for overlay true (look point 3)
TRESHOLDS(line2). โ set upper and lower THS, turn TSHs on/off
MA1(line3) โ Length/type of MA/Offset(only if MA type is LSM)
MA2(line4) โ length/offset/sigma -(remember to set ma in the way that in Uptrend MA2MA1 in DNtrend)
Use faster MA types for short term trends and slower types / bigger periods for longer term trends, defval MA1/2 settings
are pretty much random so using them is not recomended.
CROSSshape(line5) โ choose which cross type you want to plot on chart(only in OV=true) or what type you want to use in counting via for loops,
CROSScount(line6) โ set lookback for type of cross choosen above
BOOLs in lines 5 and 6 - plotshape if OV=true/plot CROSScount histogram (if OV=false)
Lines 7 and 8 โ PRESET we want to use /SRC for calculation of indicator/are conditions described below/which MAs to use/Condition for
reducing value t 0 - (if PRESET is ABSOLUTE or SIMPLE only SRC should be set(Line 8 does not matter if not CUSTOM))
5)SOURCE for CONDS:
Here you can choose between H/L and OHLC. If H/L value grow when MAlow. If OHLC MAOHLC. H/L is set by default and recommended. This can be selected for all presets not only CUSTOM
6)CROSS types LIST:
โ1 means MA1, 2 is MA2 and 3 I cross of MA1/MA2. L stands for low and H for high so for example 2H means cross of MA2 and highโ
NAME -DEFINITION Number of possible crosses
1L - cross of MA1 and low 1
1H - cross of MA1 and high 1
1HL - cross of MA1 and low or MA1 and high 2 -1L/1H
2L - cross of MA2 and low 1
2H - cross of MA2 and high 1
2HL - cross of MA2 and low or MA1 and high 2 -2L/2H
12L - cross of MA1 and low or MA2 and low 2 -1L/2L
12H - cross of MA1 and high or MA2 and high 2 -1H/2H
12HL - MA1/2 and high/low 4 -1H/1L/2H/2L
3 -cross of MA1 and MA2 1
123HL -crosses from 12HL or 3 5 -12HL/3
1_ULT - cross of MA1 with any of price sources(close,low,high,ohlc4 etcโฆ)
2_ULT - cross of MA2 with any of price sources(close,low,high,ohlc4 etcโฆ)
123_ULT โ all crosses possible of MA1/2 (all of the above so a lot)
7)CRS CONDS:
โconditions to reduce value back to zeroโ
>/< - 0 if indicator shows Uptrend and thereโs a cross with high of selected MA or 0 if in DNtrend and cross with low. Better for UP/DN trend detection
ALL โ 0 if cross of MA with high or low no matter the trend, better for detecting consolidation
ULT โ if any cross of selected MA, most crosses so goes to 0 most often
8)MA selection and CONDS:
-MA1: only MA1 is used,if MA1 below price value grows and the other way around
MA1price =-0.02
-MA2 โ only MA2 is used, same conditions as MA1 but using MA2
MA2price =-0.02
-BOTH โ MA1 and MA2 used, grows when MA1 if below, grows faster if MA1 and MA2 are below and fastest when MA1 and MA2 are below and MA2price=-0.02
-MA1 and MA2 >price=-0.03
-MA1 and MA2 ?price and MA2>MA1=-0.04
9)CONDITIONS SELECTION SUMMARRY:
So when CUSTOM we choose :
1)SOURCE โ H/L or OHLC
2)MAs โ MA1/MA2/BOTH
3)CRS CONDS (>/<,ALL,ULT)
So for example...
if we take MA1 and ALL value will go to zero if 1HL
if MA1 and >/< - 0 if 1L or 1H (depending if value is positive or negative).(1L or 1H)
If ALL and BOTH zero when 12HL
If BOTH and ULT value goes back to zero if Theres any cross of MA1/MA2 with price or cross of MA1 and MA2.(123_ULT)
If >/< and BOTH โ 0 if 12L in DNtrend or 12H if UPtrend
10) OTHERS
-script was created on EURUSD 5M and wasn't tested on different markets
-default values of MA1/MA2 aren't optimalized so do not
-There might be a logical error in the script so let me know if you find it (most probably in 'BOTH')
-thanks to @AlifeToMake for help
-if you have any ideas to improve let me know
-there are also tooltips to help
CNTLibraryLibrary "CNTLibrary"
Custom Functions To Help Code In Pinescript V5
Coded By Christian Nataliano
First Coded In 10/06/2023
Last Edited In 22/06/2023
Huge Shout Out To ยฉ ZenAndTheArtOfTrading and his ZenLibrary V5, Some Of The Custom Functions Were Heavily Inspired By Matt's Work & His Pine Script Mastery Course
Another Shout Out To The TradingView's Team Library ta V5
//====================================================================================================================================================
// Custom Indicator Functions
//====================================================================================================================================================
GetKAMA(KAMA_lenght, Fast_KAMA, Slow_KAMA)
โโCalculates An Adaptive Moving Average Based On Perry J Kaufman's Calculations
โโParameters:
โโโโ KAMA_lenght (int) : Is The KAMA Lenght
โโโโ Fast_KAMA (int) : Is The KAMA's Fastes Moving Average
โโโโ Slow_KAMA (int) : Is The KAMA's Slowest Moving Average
โโReturns: Float Of The KAMA's Current Calculations
GetMovingAverage(Source, Lenght, Type)
โโGet Custom Moving Averages Values
โโParameters:
โโโโ Source (float) : Of The Moving Average, Defval = close
โโโโ Lenght (simple int) : Of The Moving Average, Defval = 50
โโโโ Type (string) : Of The Moving Average, Defval = Exponential Moving Average
โโReturns: The Moving Average Calculation Based On Its Given Source, Lenght & Calculation Type (Please Call Function On Global Scope)
GetDecimals()
โโCalculates how many decimals are on the quote price of the current market ยฉ ZenAndTheArtOfTrading
โโReturns: The current decimal places on the market quote price
Truncate(number, decimalPlaces)
โโTruncates (cuts) excess decimal places ยฉ ZenAndTheArtOfTrading
โโParameters:
โโโโ number (float)
โโโโ decimalPlaces (simple float)
โโReturns: The given number truncated to the given decimalPlaces
ToWhole(number)
โโConverts pips into whole numbers ยฉ ZenAndTheArtOfTrading
โโParameters:
โโโโ number (float)
โโReturns: The converted number
ToPips(number)
โโConverts whole numbers back into pips ยฉ ZenAndTheArtOfTrading
โโParameters:
โโโโ number (float)
โโReturns: The converted number
GetPctChange(value1, value2, lookback)
โโGets the percentage change between 2 float values over a given lookback period ยฉ ZenAndTheArtOfTrading
โโParameters:
โโโโ value1 (float)
โโโโ value2 (float)
โโโโ lookback (int)
BarsAboveMA(lookback, ma)
โโCounts how many candles are above the MA ยฉ ZenAndTheArtOfTrading
โโParameters:
โโโโ lookback (int)
โโโโ ma (float)
โโReturns: The bar count of how many recent bars are above the MA
BarsBelowMA(lookback, ma)
โโCounts how many candles are below the MA ยฉ ZenAndTheArtOfTrading
โโParameters:
โโโโ lookback (int)
โโโโ ma (float)
โโReturns: The bar count of how many recent bars are below the EMA
BarsCrossedMA(lookback, ma)
โโCounts how many times the EMA was crossed recently ยฉ ZenAndTheArtOfTrading
โโParameters:
โโโโ lookback (int)
โโโโ ma (float)
โโReturns: The bar count of how many times price recently crossed the EMA
GetPullbackBarCount(lookback, direction)
โโCounts how many green & red bars have printed recently (ie. pullback count) ยฉ ZenAndTheArtOfTrading
โโParameters:
โโโโ lookback (int)
โโโโ direction (int)
โโReturns: The bar count of how many candles have retraced over the given lookback & direction
GetSwingHigh(Lookback, SwingType)
โโCheck If Price Has Made A Recent Swing High
โโParameters:
โโโโ Lookback (int) : Is For The Swing High Lookback Period, Defval = 7
โโโโ SwingType (int) : Is For The Swing High Type Of Identification, Defval = 1
โโReturns: A Bool - True If Price Has Made A Recent Swing High
GetSwingLow(Lookback, SwingType)
โโCheck If Price Has Made A Recent Swing Low
โโParameters:
โโโโ Lookback (int) : Is For The Swing Low Lookback Period, Defval = 7
โโโโ SwingType (int) : Is For The Swing Low Type Of Identification, Defval = 1
โโReturns: A Bool - True If Price Has Made A Recent Swing Low
//====================================================================================================================================================
// Custom Risk Management Functions
//====================================================================================================================================================
CalculateStopLossLevel(OrderType, Entry, StopLoss)
โโCalculate StopLoss Level
โโParameters:
โโโโ OrderType (int) : Is To Determine A Long / Short Position, Defval = 1
โโโโ Entry (float) : Is The Entry Level Of The Order, Defval = na
โโโโ StopLoss (float) : Is The Custom StopLoss Distance, Defval = 2x ATR Below Close
โโReturns: Float - The StopLoss Level In Actual Price As A
CalculateStopLossDistance(OrderType, Entry, StopLoss)
โโCalculate StopLoss Distance In Pips
โโParameters:
โโโโ OrderType (int) : Is To Determine A Long / Short Position, Defval = 1
โโโโ Entry (float) : Is The Entry Level Of The Order, NEED TO INPUT PARAM
โโโโ StopLoss (float) : Level Based On Previous Calculation, NEED TO INPUT PARAM
โโReturns: Float - The StopLoss Value In Pips
CalculateTakeProfitLevel(OrderType, Entry, StopLossDistance, RiskReward)
โโCalculate TakeProfit Level
โโParameters:
โโโโ OrderType (int) : Is To Determine A Long / Short Position, Defval = 1
โโโโ Entry (float) : Is The Entry Level Of The Order, Defval = na
โโโโ StopLossDistance (float)
โโโโ RiskReward (float)
โโReturns: Float - The TakeProfit Level In Actual Price
CalculateTakeProfitDistance(OrderType, Entry, TakeProfit)
โโGet TakeProfit Distance In Pips
โโParameters:
โโโโ OrderType (int) : Is To Determine A Long / Short Position, Defval = 1
โโโโ Entry (float) : Is The Entry Level Of The Order, NEED TO INPUT PARAM
โโโโ TakeProfit (float) : Level Based On Previous Calculation, NEED TO INPUT PARAM
โโReturns: Float - The TakeProfit Value In Pips
CalculateConversionCurrency(AccountCurrency, SymbolCurrency, BaseCurrency)
โโGet The Conversion Currecny Between Current Account Currency & Current Pair's Quoted Currency (FOR FOREX ONLY)
โโParameters:
โโโโ AccountCurrency (simple string) : Is For The Account Currency Used
โโโโ SymbolCurrency (simple string) : Is For The Current Symbol Currency (Front Symbol)
โโโโ BaseCurrency (simple string) : Is For The Current Symbol Base Currency (Back Symbol)
โโReturns: Tuple Of A Bollean (Convert The Currency ?) And A String (Converted Currency)
CalculateConversionRate(ConvertCurrency, ConversionRate)
โโGet The Conversion Rate Between Current Account Currency & Current Pair's Quoted Currency (FOR FOREX ONLY)
โโParameters:
โโโโ ConvertCurrency (bool) : Is To Check If The Current Symbol Needs To Be Converted Or Not
โโโโ ConversionRate (float) : Is The Quoted Price Of The Conversion Currency (Input The request.security Function Here)
โโReturns: Float Price Of Conversion Rate (If In The Same Currency Than Return Value Will Be 1.0)
LotSize(LotSizeSimple, Balance, Risk, SLDistance, ConversionRate)
โโGet Current Lot Size
โโParameters:
โโโโ LotSizeSimple (bool) : Is To Toggle Lot Sizing Calculation (Simple Is Good Enough For Stocks & Crypto, Whilst Complex Is For Forex)
โโโโ Balance (float) : Is For The Current Account Balance To Calculate The Lot Sizing Based Off
โโโโ Risk (float) : Is For The Current Risk Per Trade To Calculate The Lot Sizing Based Off
โโโโ SLDistance (float) : Is The Current Position StopLoss Distance From Its Entry Price
โโโโ ConversionRate (float) : Is The Currency Conversion Rate (Used For Complex Lot Sizing Only)
โโReturns: Float - Position Size In Units
ToLots(Units)
โโConverts Units To Lots
โโParameters:
โโโโ Units (float) : Is For How Many Units Need To Be Converted Into Lots (Minimun 1000 Units)
โโReturns: Float - Position Size In Lots
ToUnits(Lots)
โโConverts Lots To Units
โโParameters:
โโโโ Lots (float) : Is For How Many Lots Need To Be Converted Into Units (Minimun 0.01 Units)
โโReturns: Int - Position Size In Units
ToLotsInUnits(Units)
โโConverts Units To Lots Than Back To Units
โโParameters:
โโโโ Units (float) : Is For How Many Units Need To Be Converted Into Lots (Minimun 1000 Units)
โโReturns: Float - Position Size In Lots That Were Rounded To Units
ATRTrail(OrderType, SourceType, ATRPeriod, ATRMultiplyer, SwingLookback)
โโCalculate ATR Trailing Stop
โโParameters:
โโโโ OrderType (int) : Is To Determine A Long / Short Position, Defval = 1
โโโโ SourceType (int) : Is To Determine Where To Calculate The ATR Trailing From, Defval = close
โโโโ ATRPeriod (simple int) : Is To Change Its ATR Period, Defval = 20
โโโโ ATRMultiplyer (float) : Is To Change Its ATR Trailing Distance, Defval = 1
โโโโ SwingLookback (int) : Is To Change Its Swing HiLo Lookback (Only From Source Type 5), Defval = 7
โโReturns: Float - Number Of The Current ATR Trailing
DangerZone(WinRate, AvgRRR, Filter)
โโCalculate Danger Zone Of A Given Strategy
โโParameters:
โโโโ WinRate (float) : Is The Strategy WinRate
โโโโ AvgRRR (float) : Is The Strategy Avg RRR
โโโโ Filter (float) : Is The Minimum Profit It Needs To Be Out Of BE Zone, Defval = 3
โโReturns: Int - Value, 1 If Out Of Danger Zone, 0 If BE, -1 If In Danger Zone
IsQuestionableTrades(TradeTP, TradeSL)
โโChecks For Questionable Trades (Which Are Trades That Its TP & SL Level Got Hit At The Same Candle)
โโParameters:
โโโโ TradeTP (float) : Is The Trade In Question Take Profit Level
โโโโ TradeSL (float) : Is The Trade In Question Stop Loss Level
โโReturns: Bool - True If The Last Trade Was A "Questionable Trade"
//====================================================================================================================================================
// Custom Strategy Functions
//====================================================================================================================================================
OpenLong(EntryID, LotSize, LimitPrice, StopPrice, Comment, CommentValue)
โโOpen A Long Order Based On The Given Params
โโParameters:
โโโโ EntryID (string) : Is The Trade Entry ID, Defval = "Long"
โโโโ LotSize (float) : Is The Lot Size Of The Trade, Defval = 1
โโโโ LimitPrice (float) : Is The Limit Order Price To Set The Order At, Defval = Na / Market Order Execution
โโโโ StopPrice (float) : Is The Stop Order Price To Set The Order At, Defval = Na / Market Order Execution
โโโโ Comment (string) : Is The Order Comment, Defval = Long Entry Order
โโโโ CommentValue (string) : Is For Custom Values In The Order Comment, Defval = Na
โโReturns: Void
OpenShort(EntryID, LotSize, LimitPrice, StopPrice, Comment, CommentValue)
โโOpen A Short Order Based On The Given Params
โโParameters:
โโโโ EntryID (string) : Is The Trade Entry ID, Defval = "Short"
โโโโ LotSize (float) : Is The Lot Size Of The Trade, Defval = 1
โโโโ LimitPrice (float) : Is The Limit Order Price To Set The Order At, Defval = Na / Market Order Execution
โโโโ StopPrice (float) : Is The Stop Order Price To Set The Order At, Defval = Na / Market Order Execution
โโโโ Comment (string) : Is The Order Comment, Defval = Short Entry Order
โโโโ CommentValue (string) : Is For Custom Values In The Order Comment, Defval = Na
โโReturns: Void
TP_SLExit(FromID, TPLevel, SLLevel, PercentageClose, Comment, CommentValue)
โโExits Based On Predetermined TP & SL Levels
โโParameters:
โโโโ FromID (string) : Is The Trade ID That The TP & SL Levels Be Palced
โโโโ TPLevel (float) : Is The Take Profit Level
โโโโ SLLevel (float) : Is The StopLoss Level
โโโโ PercentageClose (float) : Is The Amount To Close The Order At (In Percentage) Defval = 100
โโโโ Comment (string) : Is The Order Comment, Defval = Exit Order
โโโโ CommentValue (string) : Is For Custom Values In The Order Comment, Defval = Na
โโReturns: Void
CloseLong(ExitID, PercentageClose, Comment, CommentValue, Instant)
โโExits A Long Order Based On A Specified Condition
โโParameters:
โโโโ ExitID (string) : Is The Trade ID That Will Be Closed, Defval = "Long"
โโโโ PercentageClose (float) : Is The Amount To Close The Order At (In Percentage) Defval = 100
โโโโ Comment (string) : Is The Order Comment, Defval = Exit Order
โโโโ CommentValue (string) : Is For Custom Values In The Order Comment, Defval = Na
โโโโ Instant (bool) : Is For Exit Execution Type, Defval = false
โโReturns: Void
CloseShort(ExitID, PercentageClose, Comment, CommentValue, Instant)
โโExits A Short Order Based On A Specified Condition
โโParameters:
โโโโ ExitID (string) : Is The Trade ID That Will Be Closed, Defval = "Short"
โโโโ PercentageClose (float) : Is The Amount To Close The Order At (In Percentage) Defval = 100
โโโโ Comment (string) : Is The Order Comment, Defval = Exit Order
โโโโ CommentValue (string) : Is For Custom Values In The Order Comment, Defval = Na
โโโโ Instant (bool) : Is For Exit Execution Type, Defval = false
โโReturns: Void
BrokerCheck(Broker)
โโChecks Traded Broker With Current Loaded Chart Broker
โโParameters:
โโโโ Broker (string) : Is The Current Broker That Is Traded
โโReturns: Bool - True If Current Traded Broker Is Same As Loaded Chart Broker
OpenPC(LicenseID, OrderType, UseLimit, LimitPrice, SymbolPrefix, Symbol, SymbolSuffix, Risk, SL, TP, OrderComment, Spread)
โโCompiles Given Parameters Into An Alert String Format To Open Trades Using Pine Connector
โโParameters:
โโโโ LicenseID (string) : Is The Users PineConnector LicenseID
โโโโ OrderType (int) : Is The Desired OrderType To Open
โโโโ UseLimit (bool) : Is If We Want To Enter The Position At Exactly The Previous Closing Price
โโโโ LimitPrice (float) : Is The Limit Price Of The Trade (Only For Pending Orders)
โโโโ SymbolPrefix (string) : Is The Current Symbol Prefix (If Any)
โโโโ Symbol (string) : Is The Traded Symbol
โโโโ SymbolSuffix (string) : Is The Current Symbol Suffix (If Any)
โโโโ Risk (float) : Is The Trade Risk Per Trade / Fixed Lot Sizing
โโโโ SL (float) : Is The Trade SL In Price / In Pips
โโโโ TP (float) : Is The Trade TP In Price / In Pips
โโโโ OrderComment (string) : Is The Executed Trade Comment
โโโโ Spread (float) : is The Maximum Spread For Execution
โโReturns: String - Pine Connector Order Syntax Alert Message
ClosePC(LicenseID, OrderType, SymbolPrefix, Symbol, SymbolSuffix)
โโCompiles Given Parameters Into An Alert String Format To Close Trades Using Pine Connector
โโParameters:
โโโโ LicenseID (string) : Is The Users PineConnector LicenseID
โโโโ OrderType (int) : Is The Desired OrderType To Close
โโโโ SymbolPrefix (string) : Is The Current Symbol Prefix (If Any)
โโโโ Symbol (string) : Is The Traded Symbol
โโโโ SymbolSuffix (string) : Is The Current Symbol Suffix (If Any)
โโReturns: String - Pine Connector Order Syntax Alert Message
//====================================================================================================================================================
// Custom Backtesting Calculation Functions
//====================================================================================================================================================
CalculatePNL(EntryPrice, ExitPrice, LotSize, ConversionRate)
โโCalculates Trade PNL Based On Entry, Eixt & Lot Size
โโParameters:
โโโโ EntryPrice (float) : Is The Trade Entry
โโโโ ExitPrice (float) : Is The Trade Exit
โโโโ LotSize (float) : Is The Trade Sizing
โโโโ ConversionRate (float) : Is The Currency Conversion Rate (Used For Complex Lot Sizing Only)
โโReturns: Float - The Current Trade PNL
UpdateBalance(PrevBalance, PNL)
โโUpdates The Previous Ginve Balance To The Next PNL
โโParameters:
โโโโ PrevBalance (float) : Is The Previous Balance To Be Updated
โโโโ PNL (float) : Is The Current Trade PNL To Be Added
โโReturns: Float - The Current Updated PNL
CalculateSlpComm(PNL, MaxRate)
โโCalculates Random Slippage & Commisions Fees Based On The Parameters
โโParameters:
โโโโ PNL (float) : Is The Current Trade PNL
โโโโ MaxRate (float) : Is The Upper Limit (In Percentage) Of The Randomized Fee
โโReturns: Float - A Percentage Fee Of The Current Trade PNL
UpdateDD(MaxBalance, Balance)
โโCalculates & Updates The DD Based On Its Given Parameters
โโParameters:
โโโโ MaxBalance (float) : Is The Maximum Balance Ever Recorded
โโโโ Balance (float) : Is The Current Account Balance
โโReturns: Float - The Current Strategy DD
CalculateWR(TotalTrades, LongID, ShortID)
โโCalculate The Total, Long & Short Trades Win Rate
โโParameters:
โโโโ TotalTrades (int) : Are The Current Total Trades That The Strategy Has Taken
โโโโ LongID (string) : Is The Order ID Of The Long Trades Of The Strategy
โโโโ ShortID (string) : Is The Order ID Of The Short Trades Of The Strategy
โโReturns: Tuple Of Long WR%, Short WR%, Total WR%, Total Winning Trades, Total Losing Trades, Total Long Trades & Total Short Trades
CalculateAvgRRR(WinTrades, LossTrades)
โโCalculates The Overall Strategy Avg Risk Reward Ratio
โโParameters:
โโโโ WinTrades (int) : Are The Strategy Winning Trades
โโโโ LossTrades (int) : Are The Strategy Losing Trades
โโReturns: Float - The Average RRR Values
CAGR(StartTime, StartPrice, EndTime, EndPrice)
โโCalculates The CAGR Over The Given Time Period ยฉ TradingView
โโParameters:
โโโโ StartTime (int) : Is The Starting Time Of The Calculation
โโโโ StartPrice (float) : Is The Starting Price Of The Calculation
โโโโ EndTime (int) : Is The Ending Time Of The Calculation
โโโโ EndPrice (float) : Is The Ending Price Of The Calculation
โโReturns: Float - The CAGR Values
//====================================================================================================================================================
// Custom Plot Functions
//====================================================================================================================================================
EditLabels(LabelID, X1, Y1, Text, Color, TextColor, EditCondition, DeleteCondition)
โโEdit / Delete Labels
โโParameters:
โโโโ LabelID (label) : Is The ID Of The Selected Label
โโโโ X1 (int) : Is The X1 Coordinate IN BARINDEX Xloc
โโโโ Y1 (float) : Is The Y1 Coordinate IN PRICE Yloc
โโโโ Text (string) : Is The Text Than Wants To Be Written In The Label
โโโโ Color (color) : Is The Color Value Change Of The Label Text
โโโโ TextColor (color)
โโโโ EditCondition (int) : Is The Edit Condition of The Line (Setting Location / Color)
โโโโ DeleteCondition (bool) : Is The Delete Condition Of The Line If Ture Deletes The Prev Itteration Of The Line
โโReturns: Void
EditLine(LineID, X1, Y1, X2, Y2, Color, EditCondition, DeleteCondition)
โโEdit / Delete Lines
โโParameters:
โโโโ LineID (line) : Is The ID Of The Selected Line
โโโโ X1 (int) : Is The X1 Coordinate IN BARINDEX Xloc
โโโโ Y1 (float) : Is The Y1 Coordinate IN PRICE Yloc
โโโโ X2 (int) : Is The X2 Coordinate IN BARINDEX Xloc
โโโโ Y2 (float) : Is The Y2 Coordinate IN PRICE Yloc
โโโโ Color (color) : Is The Color Value Change Of The Line
โโโโ EditCondition (int) : Is The Edit Condition of The Line (Setting Location / Color)
โโโโ DeleteCondition (bool) : Is The Delete Condition Of The Line If Ture Deletes The Prev Itteration Of The Line
โโReturns: Void
//====================================================================================================================================================
// Custom Display Functions (Using Tables)
//====================================================================================================================================================
FillTable(TableID, Column, Row, Title, Value, BgColor, TextColor, ToolTip)
โโFilling The Selected Table With The Inputed Information
โโParameters:
โโโโ TableID (table) : Is The Table ID That Wants To Be Edited
โโโโ Column (int) : Is The Current Column Of The Table That Wants To Be Edited
โโโโ Row (int) : Is The Current Row Of The Table That Wants To Be Edited
โโโโ Title (string) : Is The String Title Of The Current Cell Table
โโโโ Value (string) : Is The String Value Of The Current Cell Table
โโโโ BgColor (color) : Is The Selected Color For The Current Table
โโโโ TextColor (color) : Is The Selected Color For The Current Table
โโโโ ToolTip (string) : Is The ToolTip Of The Current Cell In The Table
โโReturns: Void
DisplayBTResults(TableID, BgColor, TextColor, StartingBalance, Balance, DollarReturn, TotalPips, MaxDD)
โโFilling The Selected Table With The Inputed Information
โโParameters:
โโโโ TableID (table) : Is The Table ID That Wants To Be Edited
โโโโ BgColor (color) : Is The Selected Color For The Current Table
โโโโ TextColor (color) : Is The Selected Color For The Current Table
โโโโ StartingBalance (float) : Is The Account Starting Balance
โโโโ Balance (float)
โโโโ DollarReturn (float) : Is The Account Dollar Reture
โโโโ TotalPips (float) : Is The Total Pips Gained / loss
โโโโ MaxDD (float) : Is The Maximum Drawdown Over The Backtesting Period
โโReturns: Void
DisplayBTResultsV2(TableID, BgColor, TextColor, TotalWR, QTCount, LongWR, ShortWR, InitialCapital, CumProfit, CumFee, AvgRRR, MaxDD, CAGR, MeanDD)
โโFilling The Selected Table With The Inputed Information
โโParameters:
โโโโ TableID (table) : Is The Table ID That Wants To Be Edited
โโโโ BgColor (color) : Is The Selected Color For The Current Table
โโโโ TextColor (color) : Is The Selected Color For The Current Table
โโโโ TotalWR (float) : Is The Strategy Total WR In %
โโโโ QTCount (int) : Is The Strategy Questionable Trades Count
โโโโ LongWR (float) : Is The Strategy Total WR In %
โโโโ ShortWR (float) : Is The Strategy Total WR In %
โโโโ InitialCapital (float) : Is The Strategy Initial Starting Capital
โโโโ CumProfit (float) : Is The Strategy Ending Cumulative Profit
โโโโ CumFee (float) : Is The Strategy Ending Cumulative Fee (Based On Randomized Fee Assumptions)
โโโโ AvgRRR (float) : Is The Strategy Average Risk Reward Ratio
โโโโ MaxDD (float) : Is The Strategy Maximum DrawDown In Its Backtesting Period
โโโโ CAGR (float) : Is The Strategy Compounded Average GRowth In %
โโโโ MeanDD (float) : Is The Strategy Mean / Average Drawdown In The Backtesting Period
โโReturns: Void
//====================================================================================================================================================
// Custom Pattern Detection Functions
//====================================================================================================================================================
BullFib(priceLow, priceHigh, fibRatio)
โโCalculates A Bullish Fibonacci Value (From Swing Low To High) ยฉ ZenAndTheArtOfTrading
โโParameters:
โโโโ priceLow (float)
โโโโ priceHigh (float)
โโโโ fibRatio (float)
โโReturns: The Fibonacci Value Of The Given Ratio Between The Two Price Points
BearFib(priceLow, priceHigh, fibRatio)
โโCalculates A Bearish Fibonacci Value (From Swing High To Low) ยฉ ZenAndTheArtOfTrading
โโParameters:
โโโโ priceLow (float)
โโโโ priceHigh (float)
โโโโ fibRatio (float)
โโReturns: The Fibonacci Value Of The Given Ratio Between The Two Price Points
GetBodySize()
โโGets The Current Candle Body Size IN POINTS ยฉ ZenAndTheArtOfTrading
โโReturns: The Current Candle Body Size IN POINTS
GetTopWickSize()
โโGets The Current Candle Top Wick Size IN POINTS ยฉ ZenAndTheArtOfTrading
โโReturns: The Current Candle Top Wick Size IN POINTS
GetBottomWickSize()
โโGets The Current Candle Bottom Wick Size IN POINTS ยฉ ZenAndTheArtOfTrading
โโReturns: The Current Candle Bottom Wick Size IN POINTS
GetBodyPercent()
โโGets The Current Candle Body Size As A Percentage Of Its Entire Size Including Its Wicks ยฉ ZenAndTheArtOfTrading
โโReturns: The Current Candle Body Size IN PERCENTAGE
GetTopWickPercent()
โโGets The Current Top Wick Size As A Percentage Of Its Entire Body Size
โโReturns: Float - The Current Candle Top Wick Size IN PERCENTAGE
GetBottomWickPercent()
โโGets The Current Bottom Wick Size As A Percentage Of Its Entire Bodu Size
โโReturns: Float - The Current Candle Bottom Size IN PERCENTAGE
BullishEC(Allowance, RejectionWickSize, EngulfWick, NearSwings, SwingLookBack)
โโChecks If The Current Bar Is A Bullish Engulfing Candle
โโParameters:
โโโโ Allowance (int) : To Give Flexibility Of Engulfing Pattern Detection In Markets That Have Micro Gaps, Defval = 0
โโโโ RejectionWickSize (float) : To Filter Out long (Upper And Lower) Wick From The Bullsih Engulfing Pattern, Defval = na
โโโโ EngulfWick (bool) : To Specify If We Want The Pattern To Also Engulf Its Upper & Lower Previous Wicks, Defval = false
โโโโ NearSwings (bool) : To Specify If We Want The Pattern To Be Near A Recent Swing Low, Defval = true
โโโโ SwingLookBack (int) : To Specify How Many Bars Back To Detect A Recent Swing Low, Defval = 10
โโReturns: Bool - True If The Current Bar Matches The Requirements of a Bullish Engulfing Candle
BearishEC(Allowance, RejectionWickSize, EngulfWick, NearSwings, SwingLookBack)
โโChecks If The Current Bar Is A Bearish Engulfing Candle
โโParameters:
โโโโ Allowance (int) : To Give Flexibility Of Engulfing Pattern Detection In Markets That Have Micro Gaps, Defval = 0
โโโโ RejectionWickSize (float) : To Filter Out long (Upper And Lower) Wick From The Bearish Engulfing Pattern, Defval = na
โโโโ EngulfWick (bool) : To Specify If We Want The Pattern To Also Engulf Its Upper & Lower Previous Wicks, Defval = false
โโโโ NearSwings (bool) : To Specify If We Want The Pattern To Be Near A Recent Swing High, Defval = true
โโโโ SwingLookBack (int) : To Specify How Many Bars Back To Detect A Recent Swing High, Defval = 10
โโReturns: Bool - True If The Current Bar Matches The Requirements of a Bearish Engulfing Candle
Hammer(Fib, ColorMatch, NearSwings, SwingLookBack, ATRFilterCheck, ATRPeriod)
โโChecks If The Current Bar Is A Hammer Candle
โโParameters:
โโโโ Fib (float) : To Specify Which Fibonacci Ratio To Use When Determining The Hammer Candle, Defval = 0.382 Ratio
โโโโ ColorMatch (bool) : To Filter Only Bullish Closed Hammer Candle Pattern, Defval = false
โโโโ NearSwings (bool) : To Specify If We Want The Doji To Be Near A Recent Swing Low, Defval = true
โโโโ SwingLookBack (int) : To Specify How Many Bars Back To Detect A Recent Swing Low, Defval = 10
โโโโ ATRFilterCheck (float) : To Filter Smaller Hammer Candles That Might Be Better Classified As A Doji Candle, Defval = 1
โโโโ ATRPeriod (simple int) : To Change ATR Period Of The ATR Filter, Defval = 20
โโReturns: Bool - True If The Current Bar Matches The Requirements of a Hammer Candle
Star(Fib, ColorMatch, NearSwings, SwingLookBack, ATRFilterCheck, ATRPeriod)
โโChecks If The Current Bar Is A Hammer Candle
โโParameters:
โโโโ Fib (float) : To Specify Which Fibonacci Ratio To Use When Determining The Hammer Candle, Defval = 0.382 Ratio
โโโโ ColorMatch (bool) : To Filter Only Bullish Closed Hammer Candle Pattern, Defval = false
โโโโ NearSwings (bool) : To Specify If We Want The Doji To Be Near A Recent Swing Low, Defval = true
โโโโ SwingLookBack (int) : To Specify How Many Bars Back To Detect A Recent Swing Low, Defval = 10
โโโโ ATRFilterCheck (float) : To Filter Smaller Hammer Candles That Might Be Better Classified As A Doji Candle, Defval = 1
โโโโ ATRPeriod (simple int) : To Change ATR Period Of The ATR Filter, Defval = 20
โโReturns: Bool - True If The Current Bar Matches The Requirements of a Hammer Candle
Doji(MaxWickSize, MaxBodySize, DojiType, NearSwings, SwingLookBack)
โโChecks If The Current Bar Is A Doji Candle
โโParameters:
โโโโ MaxWickSize (float) : To Specify The Maximum Lenght Of Its Upper & Lower Wick, Defval = 2
โโโโ MaxBodySize (float) : To Specify The Maximum Lenght Of Its Candle Body IN PERCENT, Defval = 0.05
โโโโ DojiType (int)
โโโโ NearSwings (bool) : To Specify If We Want The Doji To Be Near A Recent Swing High / Low (Only In Dragonlyf / Gravestone Mode), Defval = true
โโโโ SwingLookBack (int) : To Specify How Many Bars Back To Detect A Recent Swing High / Low (Only In Dragonlyf / Gravestone Mode), Defval = 10
โโReturns: Bool - True If The Current Bar Matches The Requirements of a Doji Candle
BullishIB(Allowance, RejectionWickSize, EngulfWick, NearSwings, SwingLookBack)
โโChecks If The Current Bar Is A Bullish Harami Candle
โโParameters:
โโโโ Allowance (int) : To Give Flexibility Of Harami Pattern Detection In Markets That Have Micro Gaps, Defval = 0
โโโโ RejectionWickSize (float) : To Filter Out long (Upper And Lower) Wick From The Bullsih Harami Pattern, Defval = na
โโโโ EngulfWick (bool) : To Specify If We Want The Pattern To Also Engulf Its Upper & Lower Previous Wicks, Defval = false
โโโโ NearSwings (bool) : To Specify If We Want The Pattern To Be Near A Recent Swing Low, Defval = true
โโโโ SwingLookBack (int) : To Specify How Many Bars Back To Detect A Recent Swing Low, Defval = 10
โโReturns: Bool - True If The Current Bar Matches The Requirements of a Bullish Harami Candle
BearishIB(Allowance, RejectionWickSize, EngulfWick, NearSwings, SwingLookBack)
โโChecks If The Current Bar Is A Bullish Harami Candle
โโParameters:
โโโโ Allowance (int) : To Give Flexibility Of Harami Pattern Detection In Markets That Have Micro Gaps, Defval = 0
โโโโ RejectionWickSize (float) : To Filter Out long (Upper And Lower) Wick From The Bearish Harami Pattern, Defval = na
โโโโ EngulfWick (bool) : To Specify If We Want The Pattern To Also Engulf Its Upper & Lower Previous Wicks, Defval = false
โโโโ NearSwings (bool) : To Specify If We Want The Pattern To Be Near A Recent Swing High, Defval = true
โโโโ SwingLookBack (int) : To Specify How Many Bars Back To Detect A Recent Swing High, Defval = 10
โโReturns: Bool - True If The Current Bar Matches The Requirements of a Bearish Harami Candle
//====================================================================================================================================================
// Custom Time Functions
//====================================================================================================================================================
BarInSession(sess, useFilter)
โโDetermines if the current price bar falls inside the specified session ยฉ ZenAndTheArtOfTrading
โโParameters:
โโโโ sess (simple string)
โโโโ useFilter (bool)
โโReturns: A boolean - true if the current bar falls within the given time session
BarOutSession(sess, useFilter)
โโDetermines if the current price bar falls outside the specified session ยฉ ZenAndTheArtOfTrading
โโParameters:
โโโโ sess (simple string)
โโโโ useFilter (bool)
โโReturns: A boolean - true if the current bar falls outside the given time session
DateFilter(startTime, endTime)
โโDetermines if this bar's time falls within date filter range ยฉ ZenAndTheArtOfTrading
โโParameters:
โโโโ startTime (int)
โโโโ endTime (int)
โโReturns: A boolean - true if the current bar falls within the given dates
DayFilter(monday, tuesday, wednesday, thursday, friday, saturday, sunday)
โโChecks if the current bar's day is in the list of given days to analyze ยฉ ZenAndTheArtOfTrading
โโParameters:
โโโโ monday (bool)
โโโโ tuesday (bool)
โโโโ wednesday (bool)
โโโโ thursday (bool)
โโโโ friday (bool)
โโโโ saturday (bool)
โโโโ sunday (bool)
โโReturns: A boolean - true if the current bar's day is one of the given days
AUSSess()
โโChecks If The Current Australian Forex Session In Running
โโReturns: Bool - True If Currently The Australian Session Is Running
ASIASess()
โโChecks If The Current Asian Forex Session In Running
โโReturns: Bool - True If Currently The Asian Session Is Running
EURSess()
โโChecks If The Current European Forex Session In Running
โโReturns: Bool - True If Currently The European Session Is Running
USSess()
โโChecks If The Current US Forex Session In Running
โโReturns: Bool - True If Currently The US Session Is Running
UNIXToDate(Time, ConversionType, TimeZone)
โโConverts UNIX Time To Datetime
โโParameters:
โโโโ Time (int) : Is The UNIX Time Input
โโโโ ConversionType (int) : Is The Datetime Output Format, Defval = DD-MM-YYYY
โโโโ TimeZone (string) : Is To Convert The Outputed Datetime Into The Specified Time Zone, Defval = Exchange Time Zone
โโReturns: String - String Of Datetime
Wavemeter [theEccentricTrader]โ โ OVERVIEW
This indicator is a representation of my take on price action based wave cycle theory. The indicator counts the number of confirmed wave cycles, keeps a rolling tally of the average wave length, wave height and frequency, and displays the statistics in a table. The indicator also displays the current wave measurements as an optional feature.
โ โ CONCEPTS
Green and Red Candles
โข A green candle is one that closes with a high price equal to or above the price it opened.
โข A red candle is one that closes with a low price that is lower than the price it opened.
Swing Highs and Swing Lows
โข A swing high is a green candle or series of consecutive green candles followed by a single red candle to complete the swing and form the peak.
โข A swing low is a red candle or series of consecutive red candles followed by a single green candle to complete the swing and form the trough.
Peak and Trough Prices (Basic)
โข The peak price of a complete swing high is the high price of either the red candle that completes the swing high or the high price of the preceding green candle, depending on which is higher.
โข The trough price of a complete swing low is the low price of either the green candle that completes the swing low or the low price of the preceding red candle, depending on which is lower.
Historic Peaks and Troughs
The current, or most recent, peak and trough occurrences are referred to as occurrence zero. Previous peak and trough occurrences are referred to as historic and ordered numerically from right to left, with the most recent historic peak and trough occurrences being occurrence one.
Wave Cycles
A wave cycle is here defined as a complete two-part move between a swing high and a swing low, or a swing low and a swing high. As can be seen in the example above, the first swing high or swing low will set the course for the sequence of wave cycles that follow; a chart that begins with a swing low will form its first complete wave cycle upon the formation of the first complete swing high and vice versa.
Wave Length
Wave length is here measured in terms of bar distance between the start and end of a wave cycle. For example, if the current wave cycle ends on a swing low the wave length will be the difference in bars between the current swing low and current swing high. In such a case, if the current swing low completes on candle 100 and the current swing high completed on candle 95, we would simply subtract 95 from 100 to give us a wave length of 5 bars.
Average wave length is here measured in terms of total bars as a proportion as total waves. The average wavelength is calculated by dividing the total candles by the total wave cycles.
Wave Height
Wave height is here measured in terms of current range. For example, if the current peak price is 100 and the current trough price is 80, the wave height will be 20.
Amplitude
Amplitude is here measured in terms of current range divided by two. For example if the current peak price is 100 and the current trough price is 80, the amplitude would be calculated by subtracting 80 from 100 and dividing the answer by 2 to give us an amplitude of 10.
Frequency
Frequency is here measured in terms of wave cycles per second (Hertz). For example, if the total wave cycle count is 10 and the amount of time it has taken to complete these 10 cycles is 1-year (31,536,000 seconds), the frequency would be calculated by dividing 10 by 31,536,000 to give us a frequency of 0.00000032 Hz.
Range
The range is simply the difference between the current peak and current trough prices, generally expressed in terms of points or pips.
โ โ FEATURES
Inputs
Show Sample Period
Start Date
End Date
Position
Text Size
Show Current
Show Lines
Table
The table is colour coded, consists of two columns and, as many as, nine rows. Blue cells display the total wave cycle count and average wave measurements. Green cells display the current wave measurements. And the final row in column one, coloured black, displays the sample period. Both current wave measurements and sample period cells can be hidden at the userโs discretion.
Lines
For a visual aid to the wave cycles, I have added a blue line that traces out the waves on the chart. These lines can be hidden at the userโs discretion.
โ โ HOW TO USE
The indicator is intended for research purposes, strategy development and strategy optimisation. I hope it will be useful in helping to gain a better understanding of the underlying dynamics at play on any given market and timeframe.
For example, the indicator can be used to compare the current range and frequency with the average range and frequency, which can be useful for gauging current market conditions versus historic and getting a feel for how different markets and timeframes behave.
โ โ LIMITATIONS
Some higher timeframe candles on tickers with larger lookbacks such as the DXY , do not actually contain all the open, high, low and close (OHLC) data at the beginning of the chart. Instead, they use the close price for open, high and low prices. So, while we can determine whether the close price is higher or lower than the preceding close price, there is no way of knowing what actually happened intra-bar for these candles. And by default candles that close at the same price as the open price, will be counted as green. You can avoid this problem by utilising the sample period filter.
The green and red candle calculations are based solely on differences between open and close prices, as such I have made no attempt to account for green candles that gap lower and close below the close price of the preceding candle, or red candles that gap higher and close above the close price of the preceding candle. I can only recommend using 24-hour markets, if and where possible, as there are far fewer gaps and, generally, more data to work with. Alternatively, you can replace the scenarios with your own logic to account for the gap anomalies, if you are feeling up to the challenge.
It is also worth noting that the sample size will be limited to your Trading View subscription plan. Premium users get 20,000 candles worth of data, pro+ and pro users get 10,000, and basic users get 5,000. If upgrading is currently not an option, you can always keep a rolling tally of the statistics in an excel spreadsheet or something of the like.
Candle Counter [theEccentricTrader]โ โ OVERVIEW
This indicator counts the number of confirmed candle scenarios on any given candlestick chart and displays the statistics in a table, which can be repositioned and resized at the user's discretion.
โ โ CONCEPTS
Green and Red Candles
A green candle is one that closes with a high price equal to or above the price it opened.
A red candle is one that closes with a low price that is lower than the price it opened.
Upper Candle Trends
A higher high candle is one that closes with a higher high price than the high price of the preceding candle.
A lower high candle is one that closes with a lower high price than the high price of the preceding candle.
A double-top candle is one that closes with a high price that is equal to the high price of the preceding candle.
Lower Candle Trends
A higher low candle is one that closes with a higher low price than the low price of the preceding candle.
A lower low candle is one that closes with a lower low price than the low price of the preceding candle.
A double-bottom candle is one that closes with a low price that is equal to the low price of the preceding candle.
โ โ FEATURES
Inputs
Start Date
End Date
Position
Text Size
Show Sample Period
Show Plots
Table
The table is colour coded, consists of three columns and twenty-two rows. Blue cells denote all candle scenarios, green cells denote green candle scenarios and red cells denote red candle scenarios.
The candle scenarios are listed in the first column with their corresponding total counts to the right, in the second column. The last row in column one, row twenty-two, displays the sample period which can be adjusted or hidden via indicator settings.
Rows two and three in the third column of the table display the total green and red candles as percentages of total candles. Rows four to nine in column three, coloured blue, display the corresponding candle scenarios as percentages of total candles. Rows ten to fifteen in column three, coloured green, display the corresponding candle scenarios as percentages of total green candles. And lastly, rows sixteen to twenty-one in column three, coloured red, display the corresponding candle scenarios as percentages of total red candles.
Plots
I have added plots as a visual aid to the various candle scenarios listed in the table. Green up-arrows denote higher high candles when above bar and higher low candles when below bar. Red down-arrows denote lower high candles when above bar and lower low candles when below bar. Similarly, blue diamonds when above bar denote double-top candles and when below bar denote double-bottom candles. These plots can also be hidden via indicator settings.
โ โ HOW TO USE
This indicator is intended for research purposes and strategy development. I hope it will be useful in helping to gain a better understanding of the underlying dynamics at play on any given market and timeframe. It can, for example, give you an idea of any inherent biases such as a greater proportion of green candles to red. Or a greater proportion of higher low green candles to lower low green candles. Such information can be very useful when conducting top down analysis across multiple timeframes, or considering trailing stop loss methods.
What you do with these statistics and how far you decide to take your research is entirely up to you, the possibilities are endless.
This is just the first and most basic in a series of indicators that can be used to study objective price action scenarios and develop a systematic approach to trading.
โ โ LIMITATIONS
Some higher timeframe candles on tickers with larger lookbacks such as the DXY, do not actually contain all the open, high, low and close (OHLC) data at the beginning of the chart. Instead, they use the close price for open, high and low prices. So, while we can determine whether the close price is higher or lower than the preceding close price, there is no way of knowing what actually happened intra-bar for these candles. And by default candles that close at the same price as the open price, will be counted as green. You can avoid this problem by utilising the sample period filter.
The green and red candle calculations are based solely on differences between open and close prices, as such I have made no attempt to account for green candles that gap lower and close below the close price of the preceding candle, or red candles that gap higher and close above the close price of the preceding candle. I can only recommend using 24-hour markets, if and where possible, as there are far fewer gaps and, generally, more data to work with. Alternatively, you can replace the scenarios with your own logic to account for the gap anomalies, if you are feeling up to the challenge.
It is also worth noting that the sample size will be limited to your Trading View subscription plan. Premium users get 20,000 candles worth of data, pro+ and pro users get 10,000, and basic users get 5,000. If upgrading is currently not an option, you can always keep a rolling tally of the statistics in an excel spreadsheet or something of the like.
MomentumIndicatorsLibrary "MomentumIndicators"
This is a library of 'Momentum Indicators', also denominated as oscillators.
The purpose of this library is to organize momentum indicators in just one place, making it easy to access.
In addition, it aims to allow customized versions, not being restricted to just the price value.
An example of this use case is the popular Stochastic RSI.
# Indicators:
1. Relative Strength Index (RSI):
Measures the relative strength of recent price gains to recent price losses of an asset.
2. Rate of Change (ROC):
Measures the percentage change in price of an asset over a specified time period.
3. Stochastic Oscillator (Stoch):
Compares the current price of an asset to its price range over a specified time period.
4. True Strength Index (TSI):
Measures the price change, calculating the ratio of the price change (positive or negative) in relation to the
absolute price change.
The values of both are smoothed twice to reduce noise, and the final result is normalized
in a range between 100 and -100.
5. Stochastic Momentum Index (SMI):
Combination of the True Strength Index with a signal line to help identify turning points in the market.
6. Williams Percent Range (Williams %R):
Compares the current price of an asset to its highest high and lowest low over a specified time period.
7. Commodity Channel Index (CCI):
Measures the relationship between an asset's current price and its moving average.
8. Ultimate Oscillator (UO):
Combines three different time periods to help identify possible reversal points.
9. Moving Average Convergence/Divergence (MACD):
Shows the difference between short-term and long-term exponential moving averages.
10. Fisher Transform (FT):
Normalize prices into a Gaussian normal distribution.
11. Inverse Fisher Transform (IFT):
Transform the values of the Fisher Transform into a smaller and more easily interpretable scale is through the
application of an inverse transformation to the hyperbolic tangent function.
This transformation takes the values of the FT, which range from -infinity to +infinity, to a scale limited
between -1 and +1, allowing them to be more easily visualized and compared.
12. Premier Stochastic Oscillator (PSO):
Normalizes the standard stochastic oscillator by applying a five-period double exponential smoothing average of
the %K value, resulting in a symmetric scale of 1 to -1
# Indicators of indicators:
## Stochastic:
1. Stochastic of RSI (Relative Strengh Index)
2. Stochastic of ROC (Rate of Change)
3. Stochastic of UO (Ultimate Oscillator)
4. Stochastic of TSI (True Strengh Index)
5. Stochastic of Williams R%
6. Stochastic of CCI (Commodity Channel Index).
7. Stochastic of MACD (Moving Average Convergence/Divergence)
8. Stochastic of FT (Fisher Transform)
9. Stochastic of Volume
10. Stochastic of MFI (Money Flow Index)
11. Stochastic of On OBV (Balance Volume)
12. Stochastic of PVI (Positive Volume Index)
13. Stochastic of NVI (Negative Volume Index)
14. Stochastic of PVT (Price-Volume Trend)
15. Stochastic of VO (Volume Oscillator)
16. Stochastic of VROC (Volume Rate of Change)
## Inverse Fisher Transform:
1.Inverse Fisher Transform on RSI (Relative Strengh Index)
2.Inverse Fisher Transform on ROC (Rate of Change)
3.Inverse Fisher Transform on UO (Ultimate Oscillator)
4.Inverse Fisher Transform on Stochastic
5.Inverse Fisher Transform on TSI (True Strength Index)
6.Inverse Fisher Transform on CCI (Commodity Channel Index)
7.Inverse Fisher Transform on Fisher Transform (FT)
8.Inverse Fisher Transform on MACD (Moving Average Convergence/Divergence)
9.Inverse Fisher Transfor on Williams R% (Williams Percent Range)
10.Inverse Fisher Transfor on CMF (Chaikin Money Flow)
11.Inverse Fisher Transform on VO (Volume Oscillator)
12.Inverse Fisher Transform on VROC (Volume Rate of Change)
## Stochastic Momentum Index:
1.Stochastic Momentum Index of RSI (Relative Strength Index)
2.Stochastic Momentum Index of ROC (Rate of Change)
3.Stochastic Momentum Index of VROC (Volume Rate of Change)
4.Stochastic Momentum Index of Williams R% (Williams Percent Range)
5.Stochastic Momentum Index of FT (Fisher Transform)
6.Stochastic Momentum Index of CCI (Commodity Channel Index)
7.Stochastic Momentum Index of UO (Ultimate Oscillator)
8.Stochastic Momentum Index of MACD (Moving Average Convergence/Divergence)
9.Stochastic Momentum Index of Volume
10.Stochastic Momentum Index of MFI (Money Flow Index)
11.Stochastic Momentum Index of CMF (Chaikin Money Flow)
12.Stochastic Momentum Index of On Balance Volume (OBV)
13.Stochastic Momentum Index of Price-Volume Trend (PVT)
14.Stochastic Momentum Index of Volume Oscillator (VO)
15.Stochastic Momentum Index of Positive Volume Index (PVI)
16.Stochastic Momentum Index of Negative Volume Index (NVI)
## Relative Strength Index:
1. RSI for Volume
2. RSI for Moving Average
rsi(source, length)
โโRSI (Relative Strengh Index). Measures the relative strength of recent price gains to recent price losses of an asset.
โโParameters:
โโโโ source : (float) Source of series (close, high, low, etc.)
โโโโ length : (int) Period of loopback
โโReturns: (float) Series of RSI
roc(source, length)
โโROC (Rate of Change). Measures the percentage change in price of an asset over a specified time period.
โโParameters:
โโโโ source : (float) Source of series (close, high, low, etc.)
โโโโ length : (int) Period of loopback
โโReturns: (float) Series of ROC
stoch(kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
โโStochastic Oscillator. Compares the current price of an asset to its price range over a specified time period.
โโParameters:
โโโโ kLength
โโโโ kSmoothing : (int) Period for smoothig stochastic
โโโโ dSmoothing : (int) Period for signal (moving average of stochastic)
โโโโ maTypeK : (int) Type of Moving Average for Stochastic Oscillator
โโโโ maTypeD : (int) Type of Moving Average for Stochastic Oscillator Signal
โโโโ almaOffsetKD : (float) Offset for Arnaud Legoux Moving Average for Oscillator and Signal
โโโโ almaSigmaKD : (float) Sigma for Arnaud Legoux Moving Average for Oscillator and Signal
โโโโ lsmaOffSetKD : (int) Offset for Least Squares Moving Average for Oscillator and Signal
โโReturns: A tuple of Stochastic Oscillator and Moving Average of Stochastic Oscillator
stoch(source, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
โโStochastic Oscillator. Customized source. Compares the current price of an asset to its price range over a specified time period.
โโParameters:
โโโโ source : (float) Source of series (close, high, low, etc.)
โโโโ kLength : (int) Period of loopback to calculate the stochastic
โโโโ kSmoothing : (int) Period for smoothig stochastic
โโโโ dSmoothing : (int) Period for signal (moving average of stochastic)
โโโโ maTypeK : (int) Type of Moving Average for Stochastic Oscillator
โโโโ maTypeD : (int) Type of Moving Average for Stochastic Oscillator Signal
โโโโ almaOffsetKD : (float) Offset for Arnaud Legoux Moving Average for Stoch and Signal
โโโโ almaSigmaKD : (float) Sigma for Arnaud Legoux Moving Average for Stoch and Signal
โโโโ lsmaOffSetKD : (int) Offset for Least Squares Moving Average for Stoch and Signal
โโReturns: A tuple of Stochastic Oscillator and Moving Average of Stochastic Oscillator
tsi(source, shortLength, longLength, maType, almaOffset, almaSigma, lsmaOffSet)
โโTSI (True Strengh Index). Measures the price change, calculating the ratio of the price change (positive or negative) in relation to the absolute price change.
The values of both are smoothed twice to reduce noise, and the final result is normalized in a range between 100 and -100.
โโParameters:
โโโโ source : (float) Source of series (close, high, low, etc.)
โโโโ shortLength : (int) Short length
โโโโ longLength : (int) Long length
โโโโ maType : (int) Type of Moving Average for TSI
โโโโ almaOffset : (float) Offset for Arnaud Legoux Moving Average
โโโโ almaSigma : (float) Sigma for Arnaud Legoux Moving Average
โโโโ lsmaOffSet : (int) Offset for Least Squares Moving Average
โโReturns: (float) TSI
smi(sourceTSI, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
โโSMI (Stochastic Momentum Index). A TSI (True Strengh Index) plus a signal line.
โโParameters:
โโโโ sourceTSI : (float) Source of series for TSI (close, high, low, etc.)
โโโโ shortLengthTSI : (int) Short length for TSI
โโโโ longLengthTSI : (int) Long length for TSI
โโโโ maTypeTSI : (int) Type of Moving Average for Signal of TSI
โโโโ almaOffsetTSI : (float) Offset for Arnaud Legoux Moving Average
โโโโ almaSigmaTSI : (float) Sigma for Arnaud Legoux Moving Average
โโโโ lsmaOffSetTSI : (int) Offset for Least Squares Moving Average
โโโโ maTypeSignal
โโโโ smoothingLengthSignal
โโโโ almaOffsetSignal
โโโโ almaSigmaSignal
โโโโ lsmaOffSetSignal
โโReturns: A tuple with TSI, signal of TSI and histogram of difference
wpr(source, length)
โโWilliams R% (Williams Percent Range). Compares the current price of an asset to its highest high and lowest low over a specified time period.
โโParameters:
โโโโ source : (float) Source of series (close, high, low, etc.)
โโโโ length : (int) Period of loopback
โโReturns: (float) Series of Williams R%
cci(source, length, maType, almaOffset, almaSigma, lsmaOffSet)
โโCCI (Commodity Channel Index). Measures the relationship between an asset's current price and its moving average.
โโParameters:
โโโโ source : (float) Source of series (close, high, low, etc.)
โโโโ length : (int) Period of loopback
โโโโ maType : (int) Type of Moving Average
โโโโ almaOffset : (float) Offset for Arnaud Legoux Moving Average
โโโโ almaSigma : (float) Sigma for Arnaud Legoux Moving Average
โโโโ lsmaOffSet : (int) Offset for Least Squares Moving Average
โโReturns: (float) Series of CCI
ultimateOscillator(fastLength, middleLength, slowLength)
โโUO (Ultimate Oscilator). Combines three different time periods to help identify possible reversal points.
โโParameters:
โโโโ fastLength : (int) Fast period of loopback
โโโโ middleLength : (int) Middle period of loopback
โโโโ slowLength : (int) Slow period of loopback
โโReturns: (float) Series of Ultimate Oscilator
ultimateOscillator(source, fastLength, middleLength, slowLength)
โโUO (Ultimate Oscilator). Customized source. Combines three different time periods to help identify possible reversal points.
โโParameters:
โโโโ source : (float) Source of series (close, high, low, etc.)
โโโโ fastLength : (int) Fast period of loopback
โโโโ middleLength : (int) Middle period of loopback
โโโโ slowLength : (int) Slow period of loopback
โโReturns: (float) Series of Ultimate Oscilator
macd(source, fastLength, slowLength, signalLength, maTypeFast, maTypeSlow, maTypeMACD, almaOffset, almaSigma, lsmaOffSet)
โโMACD (Moving Average Convergence/Divergence). Shows the difference between short-term and long-term exponential moving averages.
โโParameters:
โโโโ source : (float) Source of series (close, high, low, etc.)
โโโโ fastLength : (int) Period for fast moving average
โโโโ slowLength : (int) Period for slow moving average
โโโโ signalLength : (int) Signal length
โโโโ maTypeFast : (int) Type of fast moving average
โโโโ maTypeSlow : (int) Type of slow moving average
โโโโ maTypeMACD : (int) Type of MACD moving average
โโโโ almaOffset : (float) Offset for Arnaud Legoux Moving Average
โโโโ almaSigma : (float) Sigma for Arnaud Legoux Moving Average
โโโโ lsmaOffSet : (int) Offset for Least Squares Moving Average
โโReturns: A tuple with MACD, Signal, and Histgram
fisher(length)
โโFisher Transform. Normalize prices into a Gaussian normal distribution.
โโParameters:
โโโโ length
โโReturns: A tuple with Fisher Transform and signal
fisher(source, length)
โโFisher Transform. Customized source. Normalize prices into a Gaussian normal distribution.
โโParameters:
โโโโ source : (float) Source of series (close, high, low, etc.)
โโโโ length
โโReturns: A tuple with Fisher Transform and signal
inverseFisher(source, length, subtrahend, denominator)
โโInverse Fisher Transform.
Transform the values of the Fisher Transform into a smaller and more easily interpretable scale is
through the application of an inverse transformation to the hyperbolic tangent function.
This transformation takes the values of the FT, which range from -infinity to +infinity,
to a scale limited between -1 and +1, allowing them to be more easily visualized and compared.
โโParameters:
โโโโ source : (float) Source of series (close, high, low, etc.)
โโโโ length : (int) Period for loopback
โโโโ subtrahend : (int) Denominator. Useful in unbounded indicators. For example, in CCI.
โโโโ denominator
โโReturns: (float) Series of Inverse Fisher Transform
premierStoch(length, smoothlen)
โโPremier Stochastic Oscillator (PSO).
Normalizes the standard stochastic oscillator by applying a five-period double exponential smoothing
average of the %K value, resulting in a symmetric scale of 1 to -1.
โโParameters:
โโโโ length : (int) Period for loopback
โโโโ smoothlen : (int) Period for smoothing
โโReturns: (float) Series of PSO
premierStoch(source, smoothlen, subtrahend, denominator)
โโPremier Stochastic Oscillator (PSO) of custom source.
Normalizes the source by applying a five-period double exponential smoothing average.
โโParameters:
โโโโ source : (float) Source of series (close, high, low, etc.)
โโโโ smoothlen : (int) Period for smoothing
โโโโ subtrahend : (int) Denominator. Useful in unbounded indicators. For example, in CCI.
โโโโ denominator
โโReturns: (float) Series of PSO
stochRsi(sourceRSI, lengthRSI, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
โโParameters:
โโโโ sourceRSI
โโโโ lengthRSI
โโโโ kLength
โโโโ kSmoothing
โโโโ dSmoothing
โโโโ maTypeK
โโโโ maTypeD
โโโโ almaOffsetKD
โโโโ almaSigmaKD
โโโโ lsmaOffSetKD
stochRoc(sourceROC, lengthROC, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
โโParameters:
โโโโ sourceROC
โโโโ lengthROC
โโโโ kLength
โโโโ kSmoothing
โโโโ dSmoothing
โโโโ maTypeK
โโโโ maTypeD
โโโโ almaOffsetKD
โโโโ almaSigmaKD
โโโโ lsmaOffSetKD
stochUO(fastLength, middleLength, slowLength, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
โโParameters:
โโโโ fastLength
โโโโ middleLength
โโโโ slowLength
โโโโ kLength
โโโโ kSmoothing
โโโโ dSmoothing
โโโโ maTypeK
โโโโ maTypeD
โโโโ almaOffsetKD
โโโโ almaSigmaKD
โโโโ lsmaOffSetKD
stochTSI(source, shortLength, longLength, maType, almaOffset, almaSigma, lsmaOffSet, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
โโParameters:
โโโโ source
โโโโ shortLength
โโโโ longLength
โโโโ maType
โโโโ almaOffset
โโโโ almaSigma
โโโโ lsmaOffSet
โโโโ kLength
โโโโ kSmoothing
โโโโ dSmoothing
โโโโ maTypeK
โโโโ maTypeD
โโโโ almaOffsetKD
โโโโ almaSigmaKD
โโโโ lsmaOffSetKD
stochWPR(source, length, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
โโParameters:
โโโโ source
โโโโ length
โโโโ kLength
โโโโ kSmoothing
โโโโ dSmoothing
โโโโ maTypeK
โโโโ maTypeD
โโโโ almaOffsetKD
โโโโ almaSigmaKD
โโโโ lsmaOffSetKD
stochCCI(source, length, maType, almaOffset, almaSigma, lsmaOffSet, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
โโParameters:
โโโโ source
โโโโ length
โโโโ maType
โโโโ almaOffset
โโโโ almaSigma
โโโโ lsmaOffSet
โโโโ kLength
โโโโ kSmoothing
โโโโ dSmoothing
โโโโ maTypeK
โโโโ maTypeD
โโโโ almaOffsetKD
โโโโ almaSigmaKD
โโโโ lsmaOffSetKD
stochMACD(source, fastLength, slowLength, signalLength, maTypeFast, maTypeSlow, maTypeMACD, almaOffset, almaSigma, lsmaOffSet, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
โโParameters:
โโโโ source
โโโโ fastLength
โโโโ slowLength
โโโโ signalLength
โโโโ maTypeFast
โโโโ maTypeSlow
โโโโ maTypeMACD
โโโโ almaOffset
โโโโ almaSigma
โโโโ lsmaOffSet
โโโโ kLength
โโโโ kSmoothing
โโโโ dSmoothing
โโโโ maTypeK
โโโโ maTypeD
โโโโ almaOffsetKD
โโโโ almaSigmaKD
โโโโ lsmaOffSetKD
stochFT(length, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
โโParameters:
โโโโ length
โโโโ kLength
โโโโ kSmoothing
โโโโ dSmoothing
โโโโ maTypeK
โโโโ maTypeD
โโโโ almaOffsetKD
โโโโ almaSigmaKD
โโโโ lsmaOffSetKD
stochVolume(kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
โโParameters:
โโโโ kLength
โโโโ kSmoothing
โโโโ dSmoothing
โโโโ maTypeK
โโโโ maTypeD
โโโโ almaOffsetKD
โโโโ almaSigmaKD
โโโโ lsmaOffSetKD
stochMFI(source, length, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
โโParameters:
โโโโ source
โโโโ length
โโโโ kLength
โโโโ kSmoothing
โโโโ dSmoothing
โโโโ maTypeK
โโโโ maTypeD
โโโโ almaOffsetKD
โโโโ almaSigmaKD
โโโโ lsmaOffSetKD
stochOBV(source, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
โโParameters:
โโโโ source
โโโโ kLength
โโโโ kSmoothing
โโโโ dSmoothing
โโโโ maTypeK
โโโโ maTypeD
โโโโ almaOffsetKD
โโโโ almaSigmaKD
โโโโ lsmaOffSetKD
stochPVI(source, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
โโParameters:
โโโโ source
โโโโ kLength
โโโโ kSmoothing
โโโโ dSmoothing
โโโโ maTypeK
โโโโ maTypeD
โโโโ almaOffsetKD
โโโโ almaSigmaKD
โโโโ lsmaOffSetKD
stochNVI(source, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
โโParameters:
โโโโ source
โโโโ kLength
โโโโ kSmoothing
โโโโ dSmoothing
โโโโ maTypeK
โโโโ maTypeD
โโโโ almaOffsetKD
โโโโ almaSigmaKD
โโโโ lsmaOffSetKD
stochPVT(source, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
โโParameters:
โโโโ source
โโโโ kLength
โโโโ kSmoothing
โโโโ dSmoothing
โโโโ maTypeK
โโโโ maTypeD
โโโโ almaOffsetKD
โโโโ almaSigmaKD
โโโโ lsmaOffSetKD
stochVO(shortLen, longLen, maType, almaOffset, almaSigma, lsmaOffSet, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
โโParameters:
โโโโ shortLen
โโโโ longLen
โโโโ maType
โโโโ almaOffset
โโโโ almaSigma
โโโโ lsmaOffSet
โโโโ kLength
โโโโ kSmoothing
โโโโ dSmoothing
โโโโ maTypeK
โโโโ maTypeD
โโโโ almaOffsetKD
โโโโ almaSigmaKD
โโโโ lsmaOffSetKD
stochVROC(length, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
โโParameters:
โโโโ length
โโโโ kLength
โโโโ kSmoothing
โโโโ dSmoothing
โโโโ maTypeK
โโโโ maTypeD
โโโโ almaOffsetKD
โโโโ almaSigmaKD
โโโโ lsmaOffSetKD
iftRSI(sourceRSI, lengthRSI, lengthIFT)
โโParameters:
โโโโ sourceRSI
โโโโ lengthRSI
โโโโ lengthIFT
iftROC(sourceROC, lengthROC, lengthIFT)
โโParameters:
โโโโ sourceROC
โโโโ lengthROC
โโโโ lengthIFT
iftUO(fastLength, middleLength, slowLength, lengthIFT)
โโParameters:
โโโโ fastLength
โโโโ middleLength
โโโโ slowLength
โโโโ lengthIFT
iftStoch(kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD, lengthIFT)
โโParameters:
โโโโ kLength
โโโโ kSmoothing
โโโโ dSmoothing
โโโโ maTypeK
โโโโ maTypeD
โโโโ almaOffsetKD
โโโโ almaSigmaKD
โโโโ lsmaOffSetKD
โโโโ lengthIFT
iftTSI(source, shortLength, longLength, maType, almaOffset, almaSigma, lsmaOffSet, lengthIFT)
โโParameters:
โโโโ source
โโโโ shortLength
โโโโ longLength
โโโโ maType
โโโโ almaOffset
โโโโ almaSigma
โโโโ lsmaOffSet
โโโโ lengthIFT
iftCCI(source, length, maType, almaOffset, almaSigma, lsmaOffSet, lengthIFT)
โโParameters:
โโโโ source
โโโโ length
โโโโ maType
โโโโ almaOffset
โโโโ almaSigma
โโโโ lsmaOffSet
โโโโ lengthIFT
iftFisher(length, lengthIFT)
โโParameters:
โโโโ length
โโโโ lengthIFT
iftMACD(source, fastLength, slowLength, signalLength, maTypeFast, maTypeSlow, maTypeMACD, almaOffset, almaSigma, lsmaOffSet, lengthIFT)
โโParameters:
โโโโ source
โโโโ fastLength
โโโโ slowLength
โโโโ signalLength
โโโโ maTypeFast
โโโโ maTypeSlow
โโโโ maTypeMACD
โโโโ almaOffset
โโโโ almaSigma
โโโโ lsmaOffSet
โโโโ lengthIFT
iftWPR(source, length, lengthIFT)
โโParameters:
โโโโ source
โโโโ length
โโโโ lengthIFT
iftMFI(source, length, lengthIFT)
โโParameters:
โโโโ source
โโโโ length
โโโโ lengthIFT
iftCMF(length, lengthIFT)
โโParameters:
โโโโ length
โโโโ lengthIFT
iftVO(shortLen, longLen, maType, almaOffset, almaSigma, lsmaOffSet, lengthIFT)
โโParameters:
โโโโ shortLen
โโโโ longLen
โโโโ maType
โโโโ almaOffset
โโโโ almaSigma
โโโโ lsmaOffSet
โโโโ lengthIFT
iftVROC(length, lengthIFT)
โโParameters:
โโโโ length
โโโโ lengthIFT
smiRSI(source, length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
โโParameters:
โโโโ source
โโโโ length
โโโโ shortLengthTSI
โโโโ longLengthTSI
โโโโ maTypeTSI
โโโโ almaOffsetTSI
โโโโ almaSigmaTSI
โโโโ lsmaOffSetTSI
โโโโ maTypeSignal
โโโโ smoothingLengthSignal
โโโโ almaOffsetSignal
โโโโ almaSigmaSignal
โโโโ lsmaOffSetSignal
smiROC(source, length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
โโParameters:
โโโโ source
โโโโ length
โโโโ shortLengthTSI
โโโโ longLengthTSI
โโโโ maTypeTSI
โโโโ almaOffsetTSI
โโโโ almaSigmaTSI
โโโโ lsmaOffSetTSI
โโโโ maTypeSignal
โโโโ smoothingLengthSignal
โโโโ almaOffsetSignal
โโโโ almaSigmaSignal
โโโโ lsmaOffSetSignal
smiVROC(length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
โโParameters:
โโโโ length
โโโโ shortLengthTSI
โโโโ longLengthTSI
โโโโ maTypeTSI
โโโโ almaOffsetTSI
โโโโ almaSigmaTSI
โโโโ lsmaOffSetTSI
โโโโ maTypeSignal
โโโโ smoothingLengthSignal
โโโโ almaOffsetSignal
โโโโ almaSigmaSignal
โโโโ lsmaOffSetSignal
smiWPR(source, length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
โโParameters:
โโโโ source
โโโโ length
โโโโ shortLengthTSI
โโโโ longLengthTSI
โโโโ maTypeTSI
โโโโ almaOffsetTSI
โโโโ almaSigmaTSI
โโโโ lsmaOffSetTSI
โโโโ maTypeSignal
โโโโ smoothingLengthSignal
โโโโ almaOffsetSignal
โโโโ almaSigmaSignal
โโโโ lsmaOffSetSignal
smiFT(length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
โโParameters:
โโโโ length
โโโโ shortLengthTSI
โโโโ longLengthTSI
โโโโ maTypeTSI
โโโโ almaOffsetTSI
โโโโ almaSigmaTSI
โโโโ lsmaOffSetTSI
โโโโ maTypeSignal
โโโโ smoothingLengthSignal
โโโโ almaOffsetSignal
โโโโ almaSigmaSignal
โโโโ lsmaOffSetSignal
smiFT(source, length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
โโParameters:
โโโโ source
โโโโ length
โโโโ shortLengthTSI
โโโโ longLengthTSI
โโโโ maTypeTSI
โโโโ almaOffsetTSI
โโโโ almaSigmaTSI
โโโโ lsmaOffSetTSI
โโโโ maTypeSignal
โโโโ smoothingLengthSignal
โโโโ almaOffsetSignal
โโโโ almaSigmaSignal
โโโโ lsmaOffSetSignal
smiCCI(source, length, maTypeCCI, almaOffsetCCI, almaSigmaCCI, lsmaOffSetCCI, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
โโParameters:
โโโโ source
โโโโ length
โโโโ maTypeCCI
โโโโ almaOffsetCCI
โโโโ almaSigmaCCI
โโโโ lsmaOffSetCCI
โโโโ shortLengthTSI
โโโโ longLengthTSI
โโโโ maTypeTSI
โโโโ almaOffsetTSI
โโโโ almaSigmaTSI
โโโโ lsmaOffSetTSI
โโโโ maTypeSignal
โโโโ smoothingLengthSignal
โโโโ almaOffsetSignal
โโโโ almaSigmaSignal
โโโโ lsmaOffSetSignal
smiUO(fastLength, middleLength, slowLength, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
โโParameters:
โโโโ fastLength
โโโโ middleLength
โโโโ slowLength
โโโโ shortLengthTSI
โโโโ longLengthTSI
โโโโ maTypeTSI
โโโโ almaOffsetTSI
โโโโ almaSigmaTSI
โโโโ lsmaOffSetTSI
โโโโ maTypeSignal
โโโโ smoothingLengthSignal
โโโโ almaOffsetSignal
โโโโ almaSigmaSignal
โโโโ lsmaOffSetSignal
smiMACD(source, fastLength, slowLength, signalLength, maTypeFast, maTypeSlow, maTypeMACD, almaOffset, almaSigma, lsmaOffSet, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
โโParameters:
โโโโ source
โโโโ fastLength
โโโโ slowLength
โโโโ signalLength
โโโโ maTypeFast
โโโโ maTypeSlow
โโโโ maTypeMACD
โโโโ almaOffset
โโโโ almaSigma
โโโโ lsmaOffSet
โโโโ shortLengthTSI
โโโโ longLengthTSI
โโโโ maTypeTSI
โโโโ almaOffsetTSI
โโโโ almaSigmaTSI
โโโโ lsmaOffSetTSI
โโโโ maTypeSignal
โโโโ smoothingLengthSignal
โโโโ almaOffsetSignal
โโโโ almaSigmaSignal
โโโโ lsmaOffSetSignal
smiVol(shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
โโParameters:
โโโโ shortLengthTSI
โโโโ longLengthTSI
โโโโ maTypeTSI
โโโโ almaOffsetTSI
โโโโ almaSigmaTSI
โโโโ lsmaOffSetTSI
โโโโ maTypeSignal
โโโโ smoothingLengthSignal
โโโโ almaOffsetSignal
โโโโ almaSigmaSignal
โโโโ lsmaOffSetSignal
smiMFI(source, length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
โโParameters:
โโโโ source
โโโโ length
โโโโ shortLengthTSI
โโโโ longLengthTSI
โโโโ maTypeTSI
โโโโ almaOffsetTSI
โโโโ almaSigmaTSI
โโโโ lsmaOffSetTSI
โโโโ maTypeSignal
โโโโ smoothingLengthSignal
โโโโ almaOffsetSignal
โโโโ almaSigmaSignal
โโโโ lsmaOffSetSignal
smiCMF(length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
โโParameters:
โโโโ length
โโโโ shortLengthTSI
โโโโ longLengthTSI
โโโโ maTypeTSI
โโโโ almaOffsetTSI
โโโโ almaSigmaTSI
โโโโ lsmaOffSetTSI
โโโโ maTypeSignal
โโโโ smoothingLengthSignal
โโโโ almaOffsetSignal
โโโโ almaSigmaSignal
โโโโ lsmaOffSetSignal
smiOBV(source, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
โโParameters:
โโโโ source
โโโโ shortLengthTSI
โโโโ longLengthTSI
โโโโ maTypeTSI
โโโโ almaOffsetTSI
โโโโ almaSigmaTSI
โโโโ lsmaOffSetTSI
โโโโ maTypeSignal
โโโโ smoothingLengthSignal
โโโโ almaOffsetSignal
โโโโ almaSigmaSignal
โโโโ lsmaOffSetSignal
smiPVT(source, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
โโParameters:
โโโโ source
โโโโ shortLengthTSI
โโโโ longLengthTSI
โโโโ maTypeTSI
โโโโ almaOffsetTSI
โโโโ almaSigmaTSI
โโโโ lsmaOffSetTSI
โโโโ maTypeSignal
โโโโ smoothingLengthSignal
โโโโ almaOffsetSignal
โโโโ almaSigmaSignal
โโโโ lsmaOffSetSignal
smiVO(shortLen, longLen, maType, almaOffset, almaSigma, lsmaOffSet, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
โโParameters:
โโโโ shortLen
โโโโ longLen
โโโโ maType
โโโโ almaOffset
โโโโ almaSigma
โโโโ lsmaOffSet
โโโโ shortLengthTSI
โโโโ longLengthTSI
โโโโ maTypeTSI
โโโโ almaOffsetTSI
โโโโ almaSigmaTSI
โโโโ lsmaOffSetTSI
โโโโ maTypeSignal
โโโโ smoothingLengthSignal
โโโโ almaOffsetSignal
โโโโ almaSigmaSignal
โโโโ lsmaOffSetSignal
smiPVI(source, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
โโParameters:
โโโโ source
โโโโ shortLengthTSI
โโโโ longLengthTSI
โโโโ maTypeTSI
โโโโ almaOffsetTSI
โโโโ almaSigmaTSI
โโโโ lsmaOffSetTSI
โโโโ maTypeSignal
โโโโ smoothingLengthSignal
โโโโ almaOffsetSignal
โโโโ almaSigmaSignal
โโโโ lsmaOffSetSignal
smiNVI(source, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
โโParameters:
โโโโ source
โโโโ shortLengthTSI
โโโโ longLengthTSI
โโโโ maTypeTSI
โโโโ almaOffsetTSI
โโโโ almaSigmaTSI
โโโโ lsmaOffSetTSI
โโโโ maTypeSignal
โโโโ smoothingLengthSignal
โโโโ almaOffsetSignal
โโโโ almaSigmaSignal
โโโโ lsmaOffSetSignal
rsiVolume(length)
โโParameters:
โโโโ length
rsiMA(sourceMA, lengthMA, maType, almaOffset, almaSigma, lsmaOffSet, lengthRSI)
โโParameters:
โโโโ sourceMA
โโโโ lengthMA
โโโโ maType
โโโโ almaOffset
โโโโ almaSigma
โโโโ lsmaOffSet
โโโโ lengthRSI
TRADING MADE SIMPLEThis indicator shows market structure. The standard method of using Williams Highs and Lows as pivots, is something of an approximation.
What's original here is that we follow rules to confirm Local Highs and Local Lows, and strictly enforce that a Low can only follow a confirmed High and vice-versa.
-- Highs and Lows
To confirm a candle as a Local High, you need a later candle to Close below its Low. To confirm a Local Low, you need a Close above its High.
A Low can only follow a High (after it's been confirmed). You can't go e.g High, High, Low, Low, only High, Low, High, Low.
When price makes Higher Highs and Higher Lows, market structure is said to be bullish. When price makes Lower Lows and Lower Highs, it's bearish.
I've defined the in-between Highs and Lows as "Ranging", meaning, neutral. They could be trend continuation or reversal.
-- Bullish/Bearish Breaks
A Bullish break in market structure is when the Close of the current candle goes higher than the previous confirmed Local High.
A Bearish Break is when the Close of the current candle goes lower than the most recent confirmed Local Low.
I chose to use Close rather than High to reduce edge case weirdness. The breaking candle often ends up being a big one, thus the close of that candle can be a poor entry.
You can get live warnings by setting the alert to Options: Only Once, because during a candle, the current price is taken as the Close.
Breaks are like early warnings of a change in market bias, because you're not waiting for a High or Low to be formed and confirmed.
Buy The Dip / Sell The Rally
Buy The Dip is a label I gave to the first Higher Low in a bullish market structure. Sell The Rally is the first Lower High in a bearish market structure.
These *might* be good buying/selling opportunities, but you still need to do your own analysis to confirm that.
== USAGE ==
The point of knowing market structure is so you don't make bullish bets in a bearish market and vice versa -
or if you do at least you're aware that that's what you're doing, and hopefully have some overwhelmingly good reason to do so.
These are not signals to be traded on their own. You still need a trade thesis. Use with support & resistance and your other favourite indicators.
Works on any market on any timeframe. Be aware that market structure will be different on different timeframes.
IMPORTANT: If you're not seeing what you expect, check your settings and re-read this entire description carefully. Confirming Highs and Lows can get deceptively complex.